{"_id":"@pothos/plugin-zod","_rev":"11-5d03cfc670f483dc695287293b69e06a","name":"@pothos/plugin-zod","dist-tags":{"next":"4.0.0-next.0","latest":"4.3.2"},"versions":{"4.0.0-next.0":{"name":"@pothos/plugin-zod","version":"4.0.0-next.0","keywords":["pothos","graphql","schema","typescript","zod","validation","validate"],"author":{"name":"Michael Hayes"},"license":"ISC","_id":"@pothos/plugin-zod@4.0.0-next.0","maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"homepage":"https://github.com/hayes/pothos#readme","bugs":{"url":"https://github.com/hayes/pothos/issues"},"dist":{"shasum":"be3dd10ef88ce7d30ebc6fa3797aaf28d8d8a008","tarball":"https://registry.npmjs.org/@pothos/plugin-zod/-/plugin-zod-4.0.0-next.0.tgz","fileCount":41,"integrity":"sha512-PBCUEbo55SvSkOGuOu9qsRspaV42Va9nIMLwcOYUaLziM2cXM9GHAyKB2EnrHDTu8wZVaSuLaSgs7LiWktFtdg==","signatures":[{"sig":"MEUCICttJm7o6Iv3EkhFtAoMeCk/y+dVpfjXdZBMLOx6S+lOAiEAhR0c9cD9L7dQoJPVlX7O+2w209/dT96X5WrjlKoFH6M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127359},"main":"./lib/index.js","_from":"file:pothos-plugin-zod-4.0.0-next.0.tgz","types":"./dts/index.d.ts","module":"./esm/index.js","exports":{"import":{"default":"./esm/index.js"},"require":{"types":"./dts/index.d.ts","default":"./lib/index.js"}},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"pnpm vitest --run --segfault-retry=3","type":"tsc --project tsconfig.type.json","build":"pnpm build:clean && pnpm build:cjs && pnpm build:dts && pnpm build:esm","build:cjs":"swc src -d lib --config-file ../../.swcrc -C module.type=commonjs --strip-leading-paths","build:dts":"tsc","build:esm":"cp -r dts/* esm/ && swc src -d esm --config-file ../../.swcrc -C module.type=es6 --strip-leading-paths && pnpm esm:extensions","build:clean":"git clean -dfX esm lib","esm:extensions":"TS_NODE_PROJECT=../../tsconfig.json node -r @swc-node/register ../../scripts/esm-transformer.ts"},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"_resolved":"/private/var/folders/04/_n4g7ny53j7gp41gkp5xz3yw0000gn/T/e72f08a3053b2d677dc4fcb1acd9c938/pothos-plugin-zod-4.0.0-next.0.tgz","_integrity":"sha512-PBCUEbo55SvSkOGuOu9qsRspaV42Va9nIMLwcOYUaLziM2cXM9GHAyKB2EnrHDTu8wZVaSuLaSgs7LiWktFtdg==","repository":{"url":"git+https://github.com/hayes/pothos.git","type":"git","directory":"packages/plugin-zod"},"_npmVersion":"10.7.0","description":"A Pothos plugin for adding argument validation","directories":{},"_nodeVersion":"22.2.0","publishConfig":{"access":"public","provenance":false},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.23.8","graphql":"^16.9.0","graphql-tag":"^2.12.6","@pothos/core":"4.0.0-next.0","@pothos/test-utils":"2.0.0-next.0"},"peerDependencies":{"zod":"*","graphql":"^16.8.1","@pothos/core":"4.0.0-next.0"},"_npmOperationalInternal":{"tmp":"tmp/plugin-zod_4.0.0-next.0_1719979154581_0.5283054173631085","host":"s3://npm-registry-packages"}},"4.0.0-next.1":{"name":"@pothos/plugin-zod","version":"4.0.0-next.1","keywords":["pothos","graphql","schema","typescript","zod","validation","validate"],"author":{"name":"Michael Hayes"},"license":"ISC","_id":"@pothos/plugin-zod@4.0.0-next.1","maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"homepage":"https://github.com/hayes/pothos#readme","bugs":{"url":"https://github.com/hayes/pothos/issues"},"dist":{"shasum":"7ee49a9ac42e0ca2a5877825025d2b532f56e0a2","tarball":"https://registry.npmjs.org/@pothos/plugin-zod/-/plugin-zod-4.0.0-next.1.tgz","fileCount":41,"integrity":"sha512-e9LxSC3ZSJGSGzkxSJ5kNh+r29Svcmazn19dsIDyT+P1b3JzKTCf7COWyx5+6ZioqFn0fIMsOXU8si7nKY6YBg==","signatures":[{"sig":"MEUCIA66wytHtGJ3u5NlQF9M5KFQ0hKALkK4W2gRR/X57pADAiEA7EDoFY5a0AVoNw4qz55wL7BOOE5Y1Y92nfV1k3qp6Wg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":127466},"main":"./lib/index.js","_from":"file:pothos-plugin-zod-4.0.0-next.1.tgz","types":"./dts/index.d.ts","module":"./esm/index.js","exports":{"import":{"default":"./esm/index.js"},"require":{"types":"./dts/index.d.ts","default":"./lib/index.js"}},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"pnpm vitest --run --segfault-retry=3","type":"tsc --project tsconfig.type.json","build":"pnpm build:clean && pnpm build:cjs && pnpm build:dts && pnpm build:esm","build:cjs":"swc src -d lib --config-file ../../.swcrc -C module.type=commonjs --strip-leading-paths","build:dts":"tsc","build:esm":"cp -r dts/* esm/ && swc src -d esm --config-file ../../.swcrc -C module.type=es6 --strip-leading-paths && pnpm esm:extensions","build:clean":"git clean -dfX esm lib","esm:extensions":"TS_NODE_PROJECT=../../tsconfig.json node -r @swc-node/register ../../scripts/esm-transformer.ts"},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"_resolved":"/private/var/folders/04/_n4g7ny53j7gp41gkp5xz3yw0000gn/T/34fe373829c9736b1dbec4466c05ce8c/pothos-plugin-zod-4.0.0-next.1.tgz","_integrity":"sha512-e9LxSC3ZSJGSGzkxSJ5kNh+r29Svcmazn19dsIDyT+P1b3JzKTCf7COWyx5+6ZioqFn0fIMsOXU8si7nKY6YBg==","repository":{"url":"git+https://github.com/hayes/pothos.git","type":"git","directory":"packages/plugin-zod"},"_npmVersion":"10.7.0","description":"A Pothos plugin for adding argument validation","directories":{},"_nodeVersion":"22.2.0","publishConfig":{"access":"public","provenance":false},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.23.8","graphql":"^16.9.0","graphql-tag":"^2.12.6","@pothos/core":"4.0.0-next.1","@pothos/test-utils":"2.0.0-next.1"},"peerDependencies":{"zod":"*","graphql":"^16.8.1","@pothos/core":"4.0.0-next.1"},"_npmOperationalInternal":{"tmp":"tmp/plugin-zod_4.0.0-next.1_1720030506090_0.6915387965192388","host":"s3://npm-registry-packages"}},"4.0.0":{"name":"@pothos/plugin-zod","version":"4.0.0","keywords":["pothos","graphql","schema","typescript","zod","validation","validate"],"author":{"name":"Michael Hayes"},"license":"ISC","_id":"@pothos/plugin-zod@4.0.0","maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"homepage":"https://github.com/hayes/pothos#readme","bugs":{"url":"https://github.com/hayes/pothos/issues"},"dist":{"shasum":"cf87e68cae1f39658f2649b63e332252b53811c2","tarball":"https://registry.npmjs.org/@pothos/plugin-zod/-/plugin-zod-4.0.0.tgz","fileCount":41,"integrity":"sha512-+NWRmb7AkS6t90vp9kSO2t+HHyivCS4JzJutI0y6B1Ytult/ojntE/PAyWdIiIdj9dk2y912CoiylL89lhjEnQ==","signatures":[{"sig":"MEYCIQCCtITpuqV0BX/b/94nZJ0dtQP1SX2Er4Kp4xep7i9AbwIhALAMoX1P38ooBCt3R1XG+03VpSxgemd3lPlrc682JtxJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@pothos%2fplugin-zod@4.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":127668},"main":"./lib/index.js","_from":"file:pothos-plugin-zod-4.0.0.tgz","types":"./dts/index.d.ts","module":"./esm/index.js","exports":{"import":{"default":"./esm/index.js"},"require":{"types":"./dts/index.d.ts","default":"./lib/index.js"}},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"pnpm vitest --run","type":"tsc --project tsconfig.type.json","build":"pnpm build:clean && pnpm build:cjs && pnpm build:dts && pnpm build:esm","build:cjs":"swc src -d lib --config-file ../../.swcrc -C module.type=commonjs --strip-leading-paths","build:dts":"tsc","build:esm":"cp -r dts/* esm/ && swc src -d esm --config-file ../../.swcrc -C module.type=es6 --strip-leading-paths && pnpm esm:extensions","build:clean":"git clean -dfX esm lib","esm:extensions":"TS_NODE_PROJECT=../../tsconfig.json node -r @swc-node/register ../../scripts/esm-transformer.ts"},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"_resolved":"/tmp/943b6d898d744c16cb6ffbf24436aa59/pothos-plugin-zod-4.0.0.tgz","_integrity":"sha512-+NWRmb7AkS6t90vp9kSO2t+HHyivCS4JzJutI0y6B1Ytult/ojntE/PAyWdIiIdj9dk2y912CoiylL89lhjEnQ==","repository":{"url":"git+https://github.com/hayes/pothos.git","type":"git","directory":"packages/plugin-zod"},"_npmVersion":"10.8.1","description":"A Pothos plugin for adding argument validation","directories":{},"_nodeVersion":"22.4.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.23.8","graphql":"^16.8.1","graphql-tag":"^2.12.6","@pothos/core":"4.0.0","@pothos/test-utils":"2.0.0"},"peerDependencies":{"zod":"*","graphql":"^16.8.1","@pothos/core":"4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/plugin-zod_4.0.0_1720581884143_0.5940289747964707","host":"s3://npm-registry-packages"}},"4.0.2":{"name":"@pothos/plugin-zod","version":"4.0.2","keywords":["pothos","graphql","schema","typescript","zod","validation","validate"],"author":{"name":"Michael Hayes"},"license":"ISC","_id":"@pothos/plugin-zod@4.0.2","maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"homepage":"https://github.com/hayes/pothos#readme","bugs":{"url":"https://github.com/hayes/pothos/issues"},"dist":{"shasum":"b33d9228cb596d81a650d3aaf9df4d0058d1e96f","tarball":"https://registry.npmjs.org/@pothos/plugin-zod/-/plugin-zod-4.0.2.tgz","fileCount":41,"integrity":"sha512-1+kx6pIjRkX/CE59ZEFbhvAtK3Ktv0evB8JxmHTc7mB6Ptyhxgm4JHRfc/73MdXzKJJSfRweYE78N/vWIWO4FA==","signatures":[{"sig":"MEUCIEN23pi8FZYTPcwon9cGG6LEMhseA3mE3ZmbQT9XmHbBAiEAuDVYde07W9GFagReOcL4vNk4tx/zlLbd/Csb2OwqV8g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@pothos%2fplugin-zod@4.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":127924},"main":"./lib/index.js","_from":"file:pothos-plugin-zod-4.0.2.tgz","types":"./dts/index.d.ts","module":"./esm/index.js","exports":{"import":{"default":"./esm/index.js"},"require":{"types":"./dts/index.d.ts","default":"./lib/index.js"}},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"pnpm vitest --run","type":"tsc --project tsconfig.type.json","build":"pnpm build:clean && pnpm build:cjs && pnpm build:dts && pnpm build:esm","build:cjs":"swc src -d lib --config-file ../../.swcrc -C module.type=commonjs --strip-leading-paths","build:dts":"tsc","build:esm":"cp -r dts/* esm/ && swc src -d esm --config-file ../../.swcrc -C module.type=es6 --strip-leading-paths && pnpm esm:extensions","build:clean":"git clean -dfX esm lib","esm:extensions":"TS_NODE_PROJECT=../../tsconfig.json node -r @swc-node/register ../../scripts/esm-transformer.ts"},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"_resolved":"/tmp/bf0ab9a7146a7a75f63e93832da95711/pothos-plugin-zod-4.0.2.tgz","_integrity":"sha512-1+kx6pIjRkX/CE59ZEFbhvAtK3Ktv0evB8JxmHTc7mB6Ptyhxgm4JHRfc/73MdXzKJJSfRweYE78N/vWIWO4FA==","repository":{"url":"git+https://github.com/hayes/pothos.git","type":"git","directory":"packages/plugin-zod"},"_npmVersion":"10.8.1","description":"A Pothos plugin for adding argument validation","directories":{},"_nodeVersion":"22.4.1","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.23.8","graphql":"^16.8.1","graphql-tag":"^2.12.6","@pothos/core":"4.0.2","@pothos/test-utils":"2.0.1"},"peerDependencies":{"zod":"*","graphql":">=16.6.0","@pothos/core":"4.0.2"},"_npmOperationalInternal":{"tmp":"tmp/plugin-zod_4.0.2_1720765428815_0.7963428934089958","host":"s3://npm-registry-packages"}},"4.1.0":{"name":"@pothos/plugin-zod","version":"4.1.0","keywords":["pothos","graphql","schema","typescript","zod","validation","validate"],"author":{"name":"Michael Hayes"},"license":"ISC","_id":"@pothos/plugin-zod@4.1.0","maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"homepage":"https://github.com/hayes/pothos#readme","bugs":{"url":"https://github.com/hayes/pothos/issues"},"dist":{"shasum":"23b2de45f9c228514b1400a7b98f928226d769aa","tarball":"https://registry.npmjs.org/@pothos/plugin-zod/-/plugin-zod-4.1.0.tgz","fileCount":41,"integrity":"sha512-KNAFllvYTZimY+rjELNRRUNVyN2zhZ0jIGsTDb9QVYZ8c5EBT3tHjuImu7t12GHnOAkuTimCEk/VngyMUQpEyw==","signatures":[{"sig":"MEUCIQDSUQ1PREwkeIZaac6NLHdKDrM99pxZFXXXUZM3PGQRHwIgS9oQVG7yb7S9MXSQB/GVZ9nBYFQkn/UiWHlHG3ekfh8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@pothos%2fplugin-zod@4.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":127776},"main":"./lib/index.js","_from":"file:pothos-plugin-zod-4.1.0.tgz","types":"./dts/index.d.ts","module":"./esm/index.js","exports":{"import":{"default":"./esm/index.js"},"require":{"types":"./dts/index.d.ts","default":"./lib/index.js"}},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"pnpm vitest --run","type":"tsc --project tsconfig.type.json","build":"pnpm build:clean && pnpm build:cjs && pnpm build:dts && pnpm build:esm","build:cjs":"swc src -d lib --config-file ../../.swcrc -C module.type=commonjs --strip-leading-paths","build:dts":"tsc","build:esm":"cp -r dts/* esm/ && swc src -d esm --config-file ../../.swcrc -C module.type=es6 --strip-leading-paths && pnpm esm:extensions","build:clean":"git clean -dfX esm lib","esm:extensions":"TS_NODE_PROJECT=../../tsconfig.json node -r @swc-node/register ../../scripts/esm-transformer.ts"},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"_resolved":"/tmp/008ed4e8fa49cc526fbc350447820185/pothos-plugin-zod-4.1.0.tgz","_integrity":"sha512-KNAFllvYTZimY+rjELNRRUNVyN2zhZ0jIGsTDb9QVYZ8c5EBT3tHjuImu7t12GHnOAkuTimCEk/VngyMUQpEyw==","repository":{"url":"git+https://github.com/hayes/pothos.git","type":"git","directory":"packages/plugin-zod"},"_npmVersion":"10.8.2","description":"A Pothos plugin for adding argument validation","directories":{},"_nodeVersion":"22.5.1","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.23.8","graphql":"^16.8.1","graphql-tag":"^2.12.6","@pothos/core":"4.1.0","@pothos/test-utils":"2.1.0"},"peerDependencies":{"zod":"*","graphql":">=16.6.0","@pothos/core":"*"},"_npmOperationalInternal":{"tmp":"tmp/plugin-zod_4.1.0_1722578317217_0.39896801600384446","host":"s3://npm-registry-packages"}},"4.2.0":{"name":"@pothos/plugin-zod","version":"4.2.0","keywords":["pothos","graphql","schema","typescript","zod","validation","validate"],"author":{"name":"Michael Hayes"},"license":"ISC","_id":"@pothos/plugin-zod@4.2.0","maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"homepage":"https://github.com/hayes/pothos#readme","bugs":{"url":"https://github.com/hayes/pothos/issues"},"dist":{"shasum":"47d5467473fd57611031c242fc18bdab60122c0b","tarball":"https://registry.npmjs.org/@pothos/plugin-zod/-/plugin-zod-4.2.0.tgz","fileCount":41,"integrity":"sha512-1dE+Ii6w8LlcECUZ0LgkRqtI2Q2PUlxoQopeYCUcNc6CBrpdvh6hvNHJ76Zr4VWGw5fya4D+9FvyxyJcyud0nA==","signatures":[{"sig":"MEUCIBJlJYEE4En+dzZxia7Az+pfgj7YXhgosXfIlkgrQwCdAiEAr/jW1FSousnvzNnfbdWLTKyw0ewqCZ/MZlKD/u03+Vs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@pothos%2fplugin-zod@4.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":128379},"main":"./lib/index.js","_from":"file:pothos-plugin-zod-4.2.0.tgz","types":"./dts/index.d.ts","module":"./esm/index.js","exports":{"import":{"default":"./esm/index.js"},"require":{"types":"./dts/index.d.ts","default":"./lib/index.js"}},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"pnpm vitest --run","type":"tsc --project tsconfig.type.json","build":"pnpm build:clean && pnpm build:cjs && pnpm build:dts && pnpm build:esm","build:cjs":"swc src -d lib --config-file ../../.swcrc -C module.type=commonjs --strip-leading-paths","build:dts":"tsc","build:esm":"cp -r dts/* esm/ && swc src -d esm --config-file ../../.swcrc -C module.type=es6 --strip-leading-paths && pnpm esm:extensions","build:clean":"git clean -dfX esm lib","esm:extensions":"TS_NODE_PROJECT=../../tsconfig.json node -r @swc-node/register ../../scripts/esm-transformer.ts"},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"_resolved":"/tmp/1df7471669fed0dbbe692b5aeb6b6112/pothos-plugin-zod-4.2.0.tgz","_integrity":"sha512-1dE+Ii6w8LlcECUZ0LgkRqtI2Q2PUlxoQopeYCUcNc6CBrpdvh6hvNHJ76Zr4VWGw5fya4D+9FvyxyJcyud0nA==","repository":{"url":"git+https://github.com/hayes/pothos.git","type":"git","directory":"packages/plugin-zod"},"_npmVersion":"10.9.2","description":"A Pothos plugin for adding argument validation","directories":{},"_nodeVersion":"22.13.1","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.23.8","graphql":"^16.8.1","graphql-tag":"^2.12.6","@pothos/core":"4.5.0","@pothos/test-utils":"2.1.0"},"peerDependencies":{"zod":"*","graphql":">=16.6.0","@pothos/core":"*"},"_npmOperationalInternal":{"tmp":"tmp/plugin-zod_4.2.0_1740519574873_0.3988253986393273","host":"s3://npm-registry-packages-npm-production"}},"4.2.1":{"name":"@pothos/plugin-zod","version":"4.2.1","keywords":["pothos","graphql","schema","typescript","zod","validation","validate"],"author":{"name":"Michael Hayes"},"license":"ISC","_id":"@pothos/plugin-zod@4.2.1","maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"homepage":"https://github.com/hayes/pothos#readme","bugs":{"url":"https://github.com/hayes/pothos/issues"},"dist":{"shasum":"5830f6ab2b56c9d0fb62a72506fe4df50efaecbd","tarball":"https://registry.npmjs.org/@pothos/plugin-zod/-/plugin-zod-4.2.1.tgz","fileCount":41,"integrity":"sha512-1BsqJOFg+lklzHS+HkoQ0wBiO1NvCIBfalVGrpmtqkM/LaX0SUEt88UBFh4KI254TOCAbG/4D2svGli8k9W3mg==","signatures":[{"sig":"MEQCIFIK7kYBh9I95VJDsPr3BHLWyK4kta37LHQp3BOtmFOcAiAz9Nd53ITXkdzWhcs5hXJVCYqdFfjN+K3cOCeQCHuutw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@pothos%2fplugin-zod@4.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":128414},"main":"./lib/index.js","_from":"file:pothos-plugin-zod-4.2.1.tgz","types":"./dts/index.d.ts","module":"./esm/index.js","exports":{"import":{"default":"./esm/index.js"},"require":{"types":"./dts/index.d.ts","default":"./lib/index.js"}},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"pnpm vitest --run","type":"tsc --project tsconfig.type.json","build":"pnpm build:clean && pnpm build:cjs && pnpm build:dts && pnpm build:esm","build:cjs":"swc src -d lib --config-file ../../.swcrc -C module.type=commonjs --strip-leading-paths","build:dts":"tsc","build:esm":"cp -r dts/* esm/ && swc src -d esm --config-file ../../.swcrc -C module.type=es6 --strip-leading-paths && pnpm esm:extensions","build:clean":"git clean -dfX esm lib","esm:extensions":"TS_NODE_PROJECT=../../tsconfig.json node -r @swc-node/register ../../scripts/esm-transformer.ts"},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"_resolved":"/tmp/c3402c81b51754217aa435bfa78ac94e/pothos-plugin-zod-4.2.1.tgz","_integrity":"sha512-1BsqJOFg+lklzHS+HkoQ0wBiO1NvCIBfalVGrpmtqkM/LaX0SUEt88UBFh4KI254TOCAbG/4D2svGli8k9W3mg==","repository":{"url":"git+https://github.com/hayes/pothos.git","type":"git","directory":"packages/plugin-zod"},"_npmVersion":"10.9.2","description":"A Pothos plugin for adding argument validation","directories":{},"_nodeVersion":"22.15.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.24.3","graphql-tag":"^2.12.6","@pothos/core":"4.6.2","@pothos/test-utils":"2.1.1"},"peerDependencies":{"zod":"*","graphql":">=16.6.0","@pothos/core":"*"},"_npmOperationalInternal":{"tmp":"tmp/plugin-zod_4.2.1_1746152602877_0.42783452661747123","host":"s3://npm-registry-packages-npm-production"}},"4.2.2":{"name":"@pothos/plugin-zod","version":"4.2.2","keywords":["pothos","graphql","schema","typescript","zod","validation","validate"],"author":{"name":"Michael Hayes"},"license":"ISC","_id":"@pothos/plugin-zod@4.2.2","maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"homepage":"https://github.com/hayes/pothos#readme","bugs":{"url":"https://github.com/hayes/pothos/issues"},"dist":{"shasum":"f58b0043273da1407bc43dfdcbe44e6c0fc5c302","tarball":"https://registry.npmjs.org/@pothos/plugin-zod/-/plugin-zod-4.2.2.tgz","fileCount":41,"integrity":"sha512-xUakgHgG+dbJ7tNBgE++JUF+JoQJRTKTEmSiLOvqjuixl6AEiBzIIlIocsbjGQrDhcsijMVmAvxMbBCdYNHpDg==","signatures":[{"sig":"MEUCIDxocchCw8F3EdslqLyiYnxAGRiEy+/7xd+yPlsy6/QlAiEA/4IGS8g0yakS16elRhPvo7rEMc2cyweQ5FBhbaOgvlw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@pothos%2fplugin-zod@4.2.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":128368},"main":"./lib/index.js","_from":"file:pothos-plugin-zod-4.2.2.tgz","types":"./dts/index.d.ts","module":"./esm/index.js","exports":{"import":{"default":"./esm/index.js"},"require":{"types":"./dts/index.d.ts","default":"./lib/index.js"}},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"pnpm vitest --run","type":"tsc --project tsconfig.type.json","build":"pnpm build:clean && pnpm build:cjs && pnpm build:dts && pnpm build:esm","build:cjs":"swc src -d lib --config-file ../../.swcrc -C module.type=commonjs --strip-leading-paths","build:dts":"tsc","build:esm":"cp -r dts/* esm/ && swc src -d esm --config-file ../../.swcrc -C module.type=es6 --strip-leading-paths && pnpm esm:extensions","build:clean":"git clean -dfX esm lib","esm:extensions":"TS_NODE_PROJECT=../../tsconfig.json node -r @swc-node/register ../../scripts/esm-transformer.ts"},"_npmUser":{"name":"hayes","actor":{"name":"hayes","type":"user","email":"michael@hayes.io"},"email":"michael@hayes.io"},"_resolved":"/tmp/3d1e19f690307966b66e81a090ba5c0d/pothos-plugin-zod-4.2.2.tgz","_integrity":"sha512-xUakgHgG+dbJ7tNBgE++JUF+JoQJRTKTEmSiLOvqjuixl6AEiBzIIlIocsbjGQrDhcsijMVmAvxMbBCdYNHpDg==","repository":{"url":"git+https://github.com/hayes/pothos.git","type":"git","directory":"packages/plugin-zod"},"_npmVersion":"10.9.2","description":"A Pothos plugin for adding argument validation","directories":{},"_nodeVersion":"22.16.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.25.67","graphql-tag":"^2.12.6","@pothos/core":"4.6.3","@pothos/test-utils":"2.1.2"},"peerDependencies":{"zod":"*","graphql":"^16.10.0","@pothos/core":"*"},"_npmOperationalInternal":{"tmp":"tmp/plugin-zod_4.2.2_1750288831402_0.6215035353623244","host":"s3://npm-registry-packages-npm-production"}},"4.3.0":{"name":"@pothos/plugin-zod","version":"4.3.0","keywords":["pothos","graphql","schema","typescript","zod","validation","validate"],"author":{"name":"Michael Hayes"},"license":"ISC","_id":"@pothos/plugin-zod@4.3.0","maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"homepage":"https://github.com/hayes/pothos#readme","bugs":{"url":"https://github.com/hayes/pothos/issues"},"dist":{"shasum":"c89d16e6af4b6b6ebc710d6564c1ae742d35b515","tarball":"https://registry.npmjs.org/@pothos/plugin-zod/-/plugin-zod-4.3.0.tgz","fileCount":41,"integrity":"sha512-g6fZ1Mp654sVSbXJ4yqgcdHzCI6iZdmtWJwaXutcTwZxMSz5nfOk72kXSHzxWji6zrOs+hzkJXvsLszUFcb63A==","signatures":[{"sig":"MEUCIBen9y7kNEIp+mt34GLWZ42bab6Up7Axf110tqbudU8MAiEA2TnxoIfSFlNjZb4dh2PmDPPtWHASCdXXW6WFnfwEv94=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@pothos%2fplugin-zod@4.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":129306},"main":"./lib/index.js","_from":"file:pothos-plugin-zod-4.3.0.tgz","types":"./dts/index.d.ts","module":"./esm/index.js","exports":{"import":{"default":"./esm/index.js"},"require":{"types":"./dts/index.d.ts","default":"./lib/index.js"}},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"pnpm vitest --run","type":"tsc --project tsconfig.type.json","build":"pnpm build:clean && pnpm build:cjs && pnpm build:dts && pnpm build:esm","build:cjs":"swc src -d lib --config-file ../../.swcrc -C module.type=commonjs --strip-leading-paths","build:dts":"tsc","build:esm":"cp -r dts/* esm/ && swc src -d esm --config-file ../../.swcrc -C module.type=es6 --strip-leading-paths && pnpm esm:extensions","build:clean":"git clean -dfX esm lib","esm:extensions":"TS_NODE_PROJECT=../../tsconfig.json node -r @swc-node/register ../../scripts/esm-transformer.ts"},"_npmUser":{"name":"hayes","email":"michael@hayes.io"},"_resolved":"/tmp/3066376ec6ab068bf29b0a531674e98d/pothos-plugin-zod-4.3.0.tgz","_integrity":"sha512-g6fZ1Mp654sVSbXJ4yqgcdHzCI6iZdmtWJwaXutcTwZxMSz5nfOk72kXSHzxWji6zrOs+hzkJXvsLszUFcb63A==","repository":{"url":"git+https://github.com/hayes/pothos.git","type":"git","directory":"packages/plugin-zod"},"_npmVersion":"10.9.3","description":"A Pothos plugin for adding argument validation","directories":{},"_nodeVersion":"22.19.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.1.5","graphql-tag":"^2.12.6","@pothos/core":"4.9.1","@pothos/test-utils":"2.1.3"},"peerDependencies":{"zod":"^4.*","graphql":"^16.10.0","@pothos/core":"*"},"_npmOperationalInternal":{"tmp":"tmp/plugin-zod_4.3.0_1757279825611_0.5620515110516207","host":"s3://npm-registry-packages-npm-production"}},"4.3.1":{"name":"@pothos/plugin-zod","version":"4.3.1","keywords":["pothos","graphql","schema","typescript","zod","validation","validate"],"author":{"name":"Michael Hayes"},"license":"ISC","_id":"@pothos/plugin-zod@4.3.1","maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"homepage":"https://github.com/hayes/pothos#readme","bugs":{"url":"https://github.com/hayes/pothos/issues"},"dist":{"shasum":"798e96e5577d406031d67f3d8119aa12d7b7d768","tarball":"https://registry.npmjs.org/@pothos/plugin-zod/-/plugin-zod-4.3.1.tgz","fileCount":41,"integrity":"sha512-37ybbHfjoqibUfPeVnkFbCURdSN8Ea2uu7hXE/349vfTQ7dzejRYw+8QC4ERns+rI0UUMc8ZxS23GET7/K2Rcw==","signatures":[{"sig":"MEQCIFylyVK3rP7Q/RRwJWEFDuS8vCIYFZ8XryrCfsUw9IdbAiAO1gL1cvSNolL5q87fHWwfPVxvUEwhGZRk0pBtAhJuag==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@pothos%2fplugin-zod@4.3.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":129108},"main":"./lib/index.js","_from":"file:pothos-plugin-zod-4.3.1.tgz","types":"./dts/index.d.ts","module":"./esm/index.js","exports":{"import":{"default":"./esm/index.js"},"require":{"types":"./dts/index.d.ts","default":"./lib/index.js"}},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","scripts":{"test":"pnpm vitest --run","type":"tsc --project tsconfig.type.json","build":"pnpm build:clean && pnpm build:cjs && pnpm build:dts && pnpm build:esm","build:cjs":"swc src -d lib --config-file ../../.swcrc -C module.type=commonjs --strip-leading-paths","build:dts":"tsc","build:esm":"cp -r dts/* esm/ && swc src -d esm --config-file ../../.swcrc -C module.type=es6 --strip-leading-paths","build:clean":"git clean -dfX esm lib"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:4611e612-c73f-4ae7-9282-0a348b9b1fcf"}},"_resolved":"/tmp/dc8c02321bf7e7cdfcb587b126cc9766/pothos-plugin-zod-4.3.1.tgz","_integrity":"sha512-37ybbHfjoqibUfPeVnkFbCURdSN8Ea2uu7hXE/349vfTQ7dzejRYw+8QC4ERns+rI0UUMc8ZxS23GET7/K2Rcw==","repository":{"url":"git+https://github.com/hayes/pothos.git","type":"git","directory":"packages/plugin-zod"},"_npmVersion":"11.16.0","description":"A Pothos plugin for adding argument validation","directories":{},"_nodeVersion":"24.18.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.3.6","graphql-tag":"^2.12.6","@pothos/core":"4.13.1","@pothos/test-utils":"2.2.1"},"peerDependencies":{"zod":"^4.*","graphql":"^16.10.0 || ^17.0.0","@pothos/core":"*"},"_npmOperationalInternal":{"tmp":"tmp/plugin-zod_4.3.1_1783553239437_0.5514765242469193","host":"s3://npm-registry-packages-npm-production"}},"4.3.2":{"_id":"@pothos/plugin-zod@4.3.2","bugs":{"url":"https://github.com/hayes/pothos/issues"},"dist":{"shasum":"c48e5e989d05a4792df9d8e67fd389b9f59ccaeb","tarball":"https://registry.npmjs.org/@pothos/plugin-zod/-/plugin-zod-4.3.2.tgz","fileCount":41,"integrity":"sha512-uoUXWpV3IufWg+X6y1HtHQ5WzedJDlQzyn/4KjT9Aw3aE4SIqX/6vFHEh73FvNjd6kWFWuj4/3rJhaAG7MkURA==","signatures":[{"sig":"MEQCIEd5Es1hxRlj/rkLAT359xuDAC4b9kldzJxq8DJLYQHWAiAV09OLbSVd99N8goeVjEcTGT7VDWA9Le7fnQmkheQT0A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICh5FLwB5x4BkZLAWUN10oW/X6tEGKIbuKk/zbeAgdQbAiEAugO9Ar4Mk7zrSDw7SgmbP9gIEEjjqDYazvHSf2v4SBQ="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@pothos%2fplugin-zod@4.3.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":137408},"main":"./lib/index.js","name":"@pothos/plugin-zod","_from":"file:pothos-plugin-zod-4.3.2.tgz","types":"./dts/index.d.ts","author":{"name":"Michael Hayes"},"module":"./esm/index.js","exports":{"import":{"default":"./esm/index.js"},"require":{"types":"./dts/index.d.ts","default":"./lib/index.js"}},"gitHead":"9dfe52f1975f41a111e01bf96a20033a914e2acc","license":"ISC","scripts":{"test":"pnpm vitest --run","type":"tsc --project tsconfig.type.json","build":"pnpm build:clean && pnpm build:cjs && pnpm build:dts && pnpm build:esm","build:cjs":"swc src -d lib --config-file ../../.swcrc -C module.type=commonjs --strip-leading-paths","build:dts":"tsc","build:esm":"cp -r dts/* esm/ && swc src -d esm --config-file ../../.swcrc -C module.type=es6 --strip-leading-paths","build:clean":"git clean -dfX esm lib"},"version":"4.3.2","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:4611e612-c73f-4ae7-9282-0a348b9b1fcf"}},"homepage":"https://github.com/hayes/pothos#readme","keywords":["pothos","graphql","schema","typescript","zod","validation","validate"],"_resolved":"/tmp/0f0387771f27d9ef3482dcd76d2a4f56/pothos-plugin-zod-4.3.2.tgz","_integrity":"sha512-uoUXWpV3IufWg+X6y1HtHQ5WzedJDlQzyn/4KjT9Aw3aE4SIqX/6vFHEh73FvNjd6kWFWuj4/3rJhaAG7MkURA==","repository":{"url":"git+https://github.com/hayes/pothos.git","type":"git","directory":"packages/plugin-zod"},"_npmVersion":"11.19.0","description":"A Pothos plugin for adding argument validation","directories":{},"maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"_nodeVersion":"24.20.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.3.6","graphql-tag":"^2.12.6","@pothos/core":"4.15.0","@pothos/test-utils":"2.2.1"},"peerDependencies":{"zod":"^4.*","graphql":"^16.10.0 || ^17.0.0","@pothos/core":"*"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-zod_4.3.2_1789336691875_0.5009246496038715"}}},"time":{"created":"2024-07-03T03:59:14.434Z","modified":"2026-09-13T21:58:12.545Z","4.0.0-next.0":"2024-07-03T03:59:14.764Z","4.0.0-next.1":"2024-07-03T18:15:06.270Z","4.0.0":"2024-07-10T03:24:44.310Z","4.0.2":"2024-07-12T06:23:49.045Z","4.1.0":"2024-08-02T05:58:37.360Z","4.2.0":"2025-02-25T21:39:35.072Z","4.2.1":"2025-05-02T02:23:23.077Z","4.2.2":"2025-06-18T23:20:31.584Z","4.3.0":"2025-09-07T21:17:05.802Z","4.3.1":"2026-07-08T23:27:19.600Z","4.3.2":"2026-09-13T21:58:11.977Z"},"bugs":{"url":"https://github.com/hayes/pothos/issues"},"author":{"name":"Michael Hayes"},"license":"ISC","homepage":"https://github.com/hayes/pothos#readme","keywords":["pothos","graphql","schema","typescript","zod","validation","validate"],"repository":{"url":"git+https://github.com/hayes/pothos.git","type":"git","directory":"packages/plugin-zod"},"description":"A Pothos plugin for adding argument validation","maintainers":[{"name":"hayes","email":"michael@hayes.io"}],"readme":"# Zod validation plugin\n\n> The [validation plugin](https://pothos-graphql.dev/docs/plugins/validation) is now the recommended way to validate a\n> schema. It supports zod alongside several other validation libraries. Use this page to maintain schemas that already use the zod plugin.\n\nThe zod plugin validates field arguments and input fields with [zod](https://github.com/colinhacks/zod). You attach a `validate` option wherever you accept input (a single argument, a whole field's args, an input object, or one of its fields) and the plugin builds a zod validator that runs before your resolver. It does not re-export zod; instead `validate` takes a small options object whose keys map onto the zod methods you already know (`min`, `max`, `email`, `regex`, and so on), or an actual zod schema when you want the full API.\n\n## Install\n\n```package-install\nnpm install --save zod @pothos/plugin-zod\n```\n\n## Setup\n\nAdd the plugin, then optionally hand it a `validationError` callback to shape what clients see when validation fails.\n\n```typescript\nimport SchemaBuilder from '@pothos/core';\nimport ZodPlugin from '@pothos/plugin-zod';\n\nconst builder = new SchemaBuilder({\n  plugins: [ZodPlugin],\n  zod: {\n    // Runs when validation fails. Return a string or Error, or throw your own.\n    // The default is to throw the raw ZodError.\n    validationError: (zodError, _args, _context, _info) => zodError.message,\n  },\n});\n```\n\n`validationError` receives the `ZodError`, the field's `args`, the `context`, and the GraphQL `info`. Return a `string` (thrown as a `PothosValidationError`), return an `Error` instance (thrown as-is), or throw directly. Skip it to surface the raw zod error.\n\nExamples below are separate additions to this setup; query and mutation examples are alternatives.\n\n## Validating a single argument\n\nAdd `validate` to any argument. The keys you pass are constraints for that argument's type; here an email string capped at 254 characters.\n\n```typescript\nbuilder.queryType({\n  fields: (t) => ({\n    playerByEmail: t.boolean({\n      args: {\n        email: t.arg.string({\n          required: true,\n          validate: {\n            email: true,\n            maxLength: 254,\n          },\n        }),\n      },\n      resolve: () => true,\n    }),\n  }),\n});\n```\n\n## Validating all arguments together\n\nCross-field rules (\"at least one of these,\" \"start before end\") belong on the field's own `validate`, which receives the whole args object. It can be a function, or a `[function, options]` pair when you want a message.\n\n```typescript\nbuilder.mutationType({\n  fields: (t) => ({\n    inviteToTeam: t.boolean({\n      args: {\n        email: t.arg.string({ validate: { email: true } }),\n        phone: t.arg.string(),\n      },\n      // Require at least one contact method across the two args.\n      validate: [\n        (args) => !!args.email || !!args.phone,\n        { message: 'Provide either an email address or a phone number' },\n      ],\n      resolve: () => true,\n    }),\n  }),\n});\n```\n\n## Custom messages\n\nEvery constraint accepts either a bare value or a `[value, { message }]` pair. The pair form is a `Constraint`; the options object is passed straight to the underlying zod method, so anything zod's method accepts (a `message`, and a `path` for object refinements) works.\n\n```typescript\n// Inside a field builder callback:\nt.arg.int({\n  validate: {\n    min: [0, { message: 'jersey number cannot be negative' }],\n    max: [99, { message: 'jersey number must be under 100' }],\n    int: true,\n  },\n});\n```\n\n## Lists\n\nList arguments validate the list and its items in one options object. Constraints like `minLength` / `maxLength` / `length` apply to the array; `items` carries the constraints for each element.\n\nThe following resolver replaces an in-memory roster only after both the list length and each\nemail address pass validation. A failed constraint leaves the previous roster unchanged.\n\n```typescript\nlet emails: string[] = [];\n```\n\n```typescript\nbuilder.mutationType({\n  fields: (t) => ({\n    setRoster: t.stringList({\n      args: {\n        emails: t.arg.stringList({\n          required: true,\n          validate: {\n            maxLength: [2, { message: 'Roster is too large' }],\n            items: { email: [true, { message: 'Enter a valid email' }] },\n          },\n        }),\n      },\n      resolve: (_, args) => {\n        emails = args.emails;\n        return emails;\n      },\n    }),\n  }),\n});\n```\n\n`items` also accepts a refinement function or a `[function, { message }]` pair. For example,\ninside a field's arguments:\n\n```typescript\nt.arg.stringList({\n  validate: {\n    items: [(value) => value.trim().length > 0, { message: 'Items must not be blank' }],\n  },\n});\n```\n\n## Input objects\n\n`validate` works the same on an input type and on its fields. Put per-field rules on each field, and cross-field rules on the input type itself, where the callback receives the whole object.\n\n```typescript\nconst RegisterTeamInput = builder.inputType('RegisterTeamInput', {\n  fields: (t) => ({\n    name: t.string({ required: true, validate: { minLength: 3, maxLength: 40 } }),\n    contactEmail: t.string({ required: true, validate: { email: true } }),\n    backupEmail: t.string({ required: false, validate: { email: true } }),\n  }),\n  // Runs against the assembled input object.\n  validate: [\n    (input) => input.contactEmail !== input.backupEmail,\n    { message: 'backup email must differ from contact email' },\n  ],\n});\n```\n\n## Bring your own zod schema\n\nPass an existing zod schema with the `schema` key to reuse its rules on an argument:\n\n```typescript\nimport { z } from 'zod';\n\nt.arg.int({\n  validate: {\n    schema: z.number().int().max(5),\n  },\n});\n```\n\n...or on the whole field, validating every argument at once:\n\n```typescript\nbuilder.queryType({\n  fields: (t) => ({\n    validateCredentials: t.boolean({\n      args: {\n        email: t.arg.string({ required: true }),\n        password: t.arg.string({ required: true }),\n      },\n      validate: {\n        schema: z.object({\n          email: z.string().email(),\n          password: z.string().min(8),\n        }),\n      },\n      resolve: () => true,\n    }),\n  }),\n});\n```\n\nYou can combine `schema` with the constraint keys. The plugin pipes your schema into the generated validator, so both run. Validation uses `parseAsync` before the resolver, so refinements may return a `Promise<boolean>`. The parsed value is passed to the resolver. This plugin does not infer transformed argument types; use the [validation plugin](https://pothos-graphql.dev/docs/plugins/validation) when transforms change the resolver argument shape.\n\n## Constraint reference\n\n`validate` accepts a bare refinement function, an array of them, or an options object. The options object always allows these keys:\n\n| Key | Type | Purpose |\n| --- | --- | --- |\n| `type` | `'number' \\| 'bigint' \\| 'boolean' \\| 'date' \\| 'string' \\| 'object' \\| 'array'` | Pin the base zod type. See [How it works](#how-it-works) for why this matters. |\n| `refine` | function or `[function, { message?, path? }]`, or an array of either | A predicate handed to zod's `refine`. Receives the validated value; returns `boolean` or `Promise<boolean>`. |\n| `schema` | `ZodType` | A zod schema piped into the generated validator. |\n\nThe remaining keys depend on the field's type. Each value is a `Constraint`, either a bare value or `[value, { message }]`:\n\n| Type | Additional keys |\n| --- | --- |\n| Number | `min`, `max`, `int`, `positive`, `nonnegative`, `negative`, `nonpositive` |\n| String | `minLength`, `maxLength`, `length`, `email`, `url`, `uuid`, `regex` |\n| Array | `minLength`, `maxLength`, `length`, `items` (nested validation options or a refinement for each element) |\n| BigInt | *(base keys only)* |\n| Boolean | *(base keys only)* |\n| Date | *(base keys only)* |\n| Object | *(base keys only)* |\n\n## How it works\n\nEach argument and input field builds its own zod validator from its `validate` options. At runtime the plugin has no access to the JavaScript type behind a GraphQL type, so when you pass plain constraints it builds a union of every base type that could satisfy them. A lone `maxLength`, for example, fits both strings and arrays:\n\n```typescript\nz.union([z.string().max(5), z.array(z.unknown()).max(5)]);\n```\n\nAn `email` constraint only fits strings, so the union collapses to one member. When the argument is not required, the whole validator is wrapped `.optional().nullable()` rather than folded into the union.\n\nSet `type` to skip the guessing and pin one base type:\n\n```typescript\n// { validate: { type: 'string', maxLength: 5 } } builds:\nz.string().max(5);\n```\n\nThree cases sidestep the union entirely:\n\n- **Input object** args and fields always validate with `z.looseObject(...)`.\n- **List** args and fields always validate with `.array()`.\n- **Refinement-only** validators (a bare function, or an options object with just `refine` and/or `schema`) validate against `z.unknown()`, since no constraint narrows the type.\n\nA `schema` is piped into whatever the plugin generates (`yourSchema.pipe(generated)`), so your schema and the constraints both run.\n\n\n\n## Sharing schemas with client code\n\nTo reuse a validator on the client, write it as an ordinary zod schema in a shared module, then attach it with `schema`:\n\n```typescript\n// shared/validators.ts\nimport { z } from 'zod';\n\nexport const jerseyNumber = z.number().int().min(0).max(99);\n```\n\n```typescript\n// server\nimport { jerseyNumber } from './shared/validators';\n\nt.arg.int({\n  validate: { schema: jerseyNumber },\n});\n```\n\n```typescript\n// client\nimport { jerseyNumber } from './shared/validators';\n\njerseyNumber.parse(23); // pass\njerseyNumber.parse(100); // throws\n```\n\nIf you would rather share the constraint options object, the plugin exports `createZodSchema` to turn one into a zod schema on demand. Type the options with the exported `ValidationOptions`:\n\n```typescript\n// shared/validators.ts\nimport type { ValidationOptions } from '@pothos/plugin-zod';\n\nexport const jerseyNumberOptions: ValidationOptions<number> = {\n  min: 0,\n  max: 99,\n  int: true,\n};\n```\n\n```typescript\n// server\nimport { jerseyNumberOptions } from './shared/validators';\n\nt.arg.int({ validate: jerseyNumberOptions });\n```\n\n```typescript\n// client\nimport { createZodSchema } from '@pothos/plugin-zod';\nimport { jerseyNumberOptions } from './shared/validators';\n\nconst validator = createZodSchema(jerseyNumberOptions);\n\nvalidator.parse(23); // pass\nvalidator.parse(100); // throws\n```\n","readmeFilename":"README.md"}