{"_id":"@byside/zod-to-gql","_rev":"6-b61d72868ddcecd1ff720410603dc8e4","name":"@byside/zod-to-gql","dist-tags":{"latest":"0.5.1"},"versions":{"0.1.0":{"name":"@byside/zod-to-gql","version":"0.1.0","keywords":["zod","graphql","schema","sdl","typescript"],"author":{"name":"Byside"},"license":"MIT","_id":"@byside/zod-to-gql@0.1.0","maintainers":[{"name":"tshelburne","email":"shelburt02@gmail.com"}],"homepage":"https://github.com/byside/tools#readme","bugs":{"url":"https://github.com/byside/tools/issues"},"dist":{"shasum":"5851691c0282f5d32d348b03c261de317a0e71c8","tarball":"https://registry.npmjs.org/@byside/zod-to-gql/-/zod-to-gql-0.1.0.tgz","fileCount":6,"integrity":"sha512-IteM3FpneNKFe3Z9WKx9bnWjH+u47J7E9Chgey1DHmwl3V3VBIKEaAybuhEIBtc9QiP3LAdv+0SLzDQ3+gclEg==","signatures":[{"sig":"MEQCIA9yoHnENPVLq8goCj6x+8U8xVyf1om1gahiksKgN2wQAiAmbsclNf175anHnZvE+mxi5R3Ke6fkV5fZdBVAfZISzg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12493},"main":"./dist/index.js","type":"module","_from":"file:byside-zod-to-gql-0.1.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"node --import tsx --test 'src/**/*.test.ts'","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"tshelburne","email":"shelburt02@gmail.com"},"_resolved":"/tmp/c21a439ebefc18db63d8f7e06439da0f/byside-zod-to-gql-0.1.0.tgz","_integrity":"sha512-IteM3FpneNKFe3Z9WKx9bnWjH+u47J7E9Chgey1DHmwl3V3VBIKEaAybuhEIBtc9QiP3LAdv+0SLzDQ3+gclEg==","repository":{"url":"git+https://github.com/byside/tools.git","type":"git","directory":"packages/zod-to-gql"},"_npmVersion":"11.6.2","description":"Convert Zod schemas to GraphQL SDL type definitions","directories":{},"_nodeVersion":"24.11.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","zod":"^3.23.8","@types/node":"^22.10.1"},"peerDependencies":{"zod":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/zod-to-gql_0.1.0_1765212501766_0.20848254118038212","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@byside/zod-to-gql","version":"0.3.0","keywords":["zod","graphql","schema","sdl","typescript"],"author":{"name":"Byside"},"license":"MIT","_id":"@byside/zod-to-gql@0.3.0","maintainers":[{"name":"tshelburne","email":"shelburt02@gmail.com"}],"homepage":"https://github.com/tshelburne/byside-tools#readme","bugs":{"url":"https://github.com/tshelburne/byside-tools/issues"},"dist":{"shasum":"17f1d04af540bd05ab6121bd1787ce619a82911a","tarball":"https://registry.npmjs.org/@byside/zod-to-gql/-/zod-to-gql-0.3.0.tgz","fileCount":6,"integrity":"sha512-VuhIpBGN5LjYd07EP+4i6KB+NIsbpSnmt7EcpDLCg0va4KT5siFJeAlExO77HQ8fy2Xg1qV1CyOqzlqcT6RGGg==","signatures":[{"sig":"MEQCIAlb1MmuvW9bwn916/vCSa6wvz1y9SU8lVZNUANE/yyNAiA1pfzxmQicBIHRiaS0vcgCH0Ik5GMl9Ox4VQrxEhG95A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@byside%2fzod-to-gql@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":21321},"main":"./dist/index.js","type":"module","_from":"file:byside-zod-to-gql-0.3.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"node":"node --import tsx","test":"pnpm node --test 'src/**/*.test.ts'","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:04cc35b6-38a8-416d-ba06-c8f8d5d7bd38"}},"_resolved":"/tmp/c85e7c80c5ae4e4fc2e462797bcca797/byside-zod-to-gql-0.3.0.tgz","_integrity":"sha512-VuhIpBGN5LjYd07EP+4i6KB+NIsbpSnmt7EcpDLCg0va4KT5siFJeAlExO77HQ8fy2Xg1qV1CyOqzlqcT6RGGg==","repository":{"url":"git+https://github.com/tshelburne/byside-tools.git","type":"git","directory":"packages/zod-to-gql"},"_npmVersion":"11.6.2","description":"Convert Zod schemas to GraphQL SDL type definitions","directories":{},"_nodeVersion":"24.11.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","zod":"^4.0.0","@types/node":"^22.10.1"},"peerDependencies":{"zod":">=3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/zod-to-gql_0.3.0_1765873681319_0.17779614633899832","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@byside/zod-to-gql","version":"0.4.0","keywords":["zod","graphql","schema","sdl","typescript"],"author":{"name":"Byside"},"license":"MIT","_id":"@byside/zod-to-gql@0.4.0","maintainers":[{"name":"tshelburne","email":"shelburt02@gmail.com"}],"homepage":"https://github.com/tshelburne/byside-tools#readme","bugs":{"url":"https://github.com/tshelburne/byside-tools/issues"},"dist":{"shasum":"c0fab47cee845730335ce3b9def57bcbafed0c75","tarball":"https://registry.npmjs.org/@byside/zod-to-gql/-/zod-to-gql-0.4.0.tgz","fileCount":6,"integrity":"sha512-wB/6l4UyG9cURdxPMkBKs5w1Sq/FRGHyJAr9vT/PWYJtPaHE0Wu3AGqFnN//gH6+OA9q4RWVII1mJB/KYPU2xQ==","signatures":[{"sig":"MEUCIQC77YNuaS3fY0tNuh5JtGHqWi4GtsYrby6UZjzXuzKg/gIgYqjpaVqpFw6bVoBiWdt+Wcc3XErQGaWJxnJb6/nbRhg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@byside%2fzod-to-gql@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":25886},"main":"./dist/index.js","type":"module","_from":"file:byside-zod-to-gql-0.4.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"node":"node --import tsx","test":"pnpm node --test 'src/**/*.test.ts'","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:04cc35b6-38a8-416d-ba06-c8f8d5d7bd38"}},"_resolved":"/tmp/1654d23d3d5b4bb2a65871d270f4bd7d/byside-zod-to-gql-0.4.0.tgz","_integrity":"sha512-wB/6l4UyG9cURdxPMkBKs5w1Sq/FRGHyJAr9vT/PWYJtPaHE0Wu3AGqFnN//gH6+OA9q4RWVII1mJB/KYPU2xQ==","repository":{"url":"git+https://github.com/tshelburne/byside-tools.git","type":"git","directory":"packages/zod-to-gql"},"_npmVersion":"11.11.0","description":"Convert Zod schemas to GraphQL SDL type definitions","directories":{},"_nodeVersion":"24.14.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","zod":"^4.0.0","@types/node":"^22.10.1"},"peerDependencies":{"zod":">=3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/zod-to-gql_0.4.0_1776214515193_0.013662128684057917","host":"s3://npm-registry-packages-npm-production"}},"0.4.1":{"name":"@byside/zod-to-gql","version":"0.4.1","keywords":["zod","graphql","schema","sdl","typescript"],"author":{"name":"Byside"},"license":"MIT","_id":"@byside/zod-to-gql@0.4.1","maintainers":[{"name":"tshelburne","email":"shelburt02@gmail.com"}],"homepage":"https://github.com/tshelburne/byside-tools#readme","bugs":{"url":"https://github.com/tshelburne/byside-tools/issues"},"dist":{"shasum":"f710c7647a193a4fe77e18fce89fb80e3931588a","tarball":"https://registry.npmjs.org/@byside/zod-to-gql/-/zod-to-gql-0.4.1.tgz","fileCount":6,"integrity":"sha512-t0yep3gzfHqQpaTKwmTZmrtQ/g2tCdu3HNLBZi++bFD0Vj0pm5dkga1A6XkKVRDlPglUXzDoQhcCw9m/D5hr1g==","signatures":[{"sig":"MEUCIHPcnihzzsQiRpZ4SUkKj0XeC5X7LD/2ZFBzNpfZtJ/XAiEA2Ri+slDsaGMcgJj99zSM7M+nSXlGMtPa4swElbn4i0E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26070},"main":"./dist/index.js","type":"module","_from":"file:byside-zod-to-gql-0.4.1.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"node":"node --import tsx","test":"pnpm node --test 'src/**/*.test.ts'","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"tshelburne","email":"shelburt02@gmail.com"},"_resolved":"/private/var/folders/kz/0yf70f310_v8jdf58ly3379h0000gn/T/f27b89be5ffe52cc68ef8589faf4b327/byside-zod-to-gql-0.4.1.tgz","_integrity":"sha512-t0yep3gzfHqQpaTKwmTZmrtQ/g2tCdu3HNLBZi++bFD0Vj0pm5dkga1A6XkKVRDlPglUXzDoQhcCw9m/D5hr1g==","repository":{"url":"git+https://github.com/tshelburne/byside-tools.git","type":"git","directory":"packages/zod-to-gql"},"_npmVersion":"11.6.2","description":"Convert Zod schemas to GraphQL SDL type definitions","directories":{},"_nodeVersion":"25.2.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","zod":"^4.0.0","@types/node":"^22.10.1"},"peerDependencies":{"zod":">=3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/zod-to-gql_0.4.1_1784199621734_0.593797491965409","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@byside/zod-to-gql","version":"0.5.0","keywords":["zod","graphql","schema","sdl","typescript"],"author":{"name":"Byside"},"license":"MIT","_id":"@byside/zod-to-gql@0.5.0","maintainers":[{"name":"tshelburne","email":"shelburt02@gmail.com"}],"homepage":"https://github.com/tshelburne/byside-tools#readme","bugs":{"url":"https://github.com/tshelburne/byside-tools/issues"},"dist":{"shasum":"78832856c192527e6cdfcb9655b01edeea5d8e38","tarball":"https://registry.npmjs.org/@byside/zod-to-gql/-/zod-to-gql-0.5.0.tgz","fileCount":6,"integrity":"sha512-tStDGB0LAvmSaUMG9+/ijD9wuL1aoqOr73U3p1WuUsbF9JuphndqLBu32cAA5Lt8mscPumiijpBiV0JR8TfVNw==","signatures":[{"sig":"MEUCIEpRKegb64ZOP82LCSY2x6e94tfInjc8KWlAnSFNypnyAiEA6r2ZoK4sQEU3AurJYvo81GPZZ1oxGYsDwMQa/wvxARU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@byside%2fzod-to-gql@0.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":31216},"main":"./dist/index.js","type":"module","_from":"file:byside-zod-to-gql-0.5.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"node":"node --import tsx","test":"pnpm node --test 'src/**/*.test.ts'","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:04cc35b6-38a8-416d-ba06-c8f8d5d7bd38"}},"_resolved":"/tmp/5e46da13f876bd13fa0adc757ced629e/byside-zod-to-gql-0.5.0.tgz","_integrity":"sha512-tStDGB0LAvmSaUMG9+/ijD9wuL1aoqOr73U3p1WuUsbF9JuphndqLBu32cAA5Lt8mscPumiijpBiV0JR8TfVNw==","repository":{"url":"git+https://github.com/tshelburne/byside-tools.git","type":"git","directory":"packages/zod-to-gql"},"_npmVersion":"11.17.0","description":"Convert Zod schemas to GraphQL SDL type definitions","directories":{},"_nodeVersion":"24.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","zod":"^4.0.0","@types/node":"^22.10.1"},"peerDependencies":{"zod":">=3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/zod-to-gql_0.5.0_1786804548666_0.49273637348587074","host":"s3://npm-registry-packages-npm-production"}},"0.5.1":{"name":"@byside/zod-to-gql","version":"0.5.1","type":"module","description":"Convert Zod schemas to GraphQL SDL type definitions","license":"MIT","author":{"name":"Byside"},"repository":{"type":"git","url":"git+https://github.com/tshelburne/byside-tools.git","directory":"packages/zod-to-gql"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"peerDependencies":{"zod":">=3.0.0"},"devDependencies":{"@types/node":"^22.10.1","tsx":"^4.19.2","zod":"^4.0.0"},"keywords":["zod","graphql","schema","sdl","typescript"],"publishConfig":{"access":"public"},"scripts":{"node":"node --import tsx","build":"tsc -p tsconfig.build.json","test":"pnpm node --test 'src/**/*.test.ts'","typecheck":"tsc --noEmit","clean":"rm -rf dist"},"_id":"@byside/zod-to-gql@0.5.1","bugs":{"url":"https://github.com/tshelburne/byside-tools/issues"},"homepage":"https://github.com/tshelburne/byside-tools#readme","_integrity":"sha512-TMMkdCKaTgAAcKm+MvwZej9xj5BInKgTGUKYy+CtOkSELqqKxRMXdtqk1mWbYB52/kt+aVjwglUfSJUSVOqD7g==","_resolved":"/tmp/86d3f89774e281c04e38f644cf67df18/byside-zod-to-gql-0.5.1.tgz","_from":"file:byside-zod-to-gql-0.5.1.tgz","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-TMMkdCKaTgAAcKm+MvwZej9xj5BInKgTGUKYy+CtOkSELqqKxRMXdtqk1mWbYB52/kt+aVjwglUfSJUSVOqD7g==","shasum":"730288b4972471f2b5bc7c0d357c9def5b38329e","tarball":"https://registry.npmjs.org/@byside/zod-to-gql/-/zod-to-gql-0.5.1.tgz","fileCount":6,"unpackedSize":35617,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@byside%2fzod-to-gql@0.5.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICEpD+Xu3g6iq16KCHjv3iRvPtSpyaQEd6tlfJ3HCiElAiEA0YaQk3sk7Z16slZwyUA2RCbTERPWRGEzIps+06/7dSA="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:04cc35b6-38a8-416d-ba06-c8f8d5d7bd38"}},"directories":{},"maintainers":[{"name":"tshelburne","email":"shelburt02@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/zod-to-gql_0.5.1_1786807893524_0.17190550219308043"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-08T16:48:21.643Z","modified":"2026-08-15T15:31:34.036Z","0.1.0":"2025-12-08T16:48:21.922Z","0.3.0":"2025-12-16T08:28:01.480Z","0.4.0":"2026-04-15T00:55:15.367Z","0.4.1":"2026-07-16T11:00:21.888Z","0.5.0":"2026-08-15T14:35:48.819Z","0.5.1":"2026-08-15T15:31:33.654Z"},"bugs":{"url":"https://github.com/tshelburne/byside-tools/issues"},"author":{"name":"Byside"},"license":"MIT","homepage":"https://github.com/tshelburne/byside-tools#readme","keywords":["zod","graphql","schema","sdl","typescript"],"repository":{"type":"git","url":"git+https://github.com/tshelburne/byside-tools.git","directory":"packages/zod-to-gql"},"description":"Convert Zod schemas to GraphQL SDL type definitions","maintainers":[{"name":"tshelburne","email":"shelburt02@gmail.com"}],"readme":"# @byside/zod-to-gql\n\nConvert Zod schemas to GraphQL SDL type definitions.\n\n## Installation\n\n```bash\nnpm install @byside/zod-to-gql\n# or\npnpm add @byside/zod-to-gql\n```\n\n## Usage\n\n```typescript\nimport { z } from 'zod'\nimport { zodToGql, zodSchemasToGql } from '@byside/zod-to-gql'\n\n// Single schema\nconst UserSchema = z.object({\n  id: z.string().uuid(),\n  name: z.string(),\n  age: z.number().int().optional(),\n  isAdmin: z.boolean(),\n})\n\nconsole.log(zodToGql('User', UserSchema))\n// type User {\n//   id: UUID!\n//   name: String!\n//   age: Int\n//   isAdmin: Boolean!\n// }\n\n// Enum\nconst StatusSchema = z.enum(['pending', 'active', 'completed'])\nconsole.log(zodToGql('Status', StatusSchema))\n// enum Status {\n//   PENDING\n//   ACTIVE\n//   COMPLETED\n// }\n\n// Multiple schemas\nconst schemas = {\n  User: UserSchema,\n  Status: StatusSchema,\n}\nconsole.log(zodSchemasToGql(schemas))\n```\n\n## Options\n\n### Custom Scalars\n\n```typescript\nzodToGql('Entity', schema, {\n  scalars: {\n    uuid: 'ID', // Map UUID to ID instead\n    datetime: 'DateTime',\n  },\n})\n```\n\n### Named Type References\n\nReference other types instead of inlining nested objects:\n\n```typescript\nconst AddressSchema = z.object({\n  street: z.string(),\n  city: z.string(),\n})\n\nconst PersonSchema = z.object({\n  name: z.string(),\n  address: AddressSchema,\n})\n\nconst types = new Map([[AddressSchema, 'Address']])\n\nzodToGql('Person', PersonSchema, { types })\n// type Person {\n//   name: String!\n//   address: Address!\n// }\n```\n\n## Type Mappings\n\n| Zod Type                | GraphQL Type                                 |\n| ----------------------- | -------------------------------------------- |\n| `z.string()`            | `String`                                     |\n| `z.string().uuid()`     | `UUID`                                       |\n| `z.string().datetime()` | `Datetime`                                   |\n| `z.number()`            | `Float`                                      |\n| `z.number().int()`      | `Int`                                        |\n| `z.boolean()`           | `Boolean`                                    |\n| `z.array(T)`            | `[T]`                                        |\n| `z.object({})`          | `JSON` (or named type)                       |\n| `z.enum([...])`         | `String` (as field) or `enum` (as top-level) |\n| `.optional()`           | removes `!`                                  |\n| `.default()`            | keeps `!` (always present in output)         |\n\n## License\n\nMIT\n","readmeFilename":"README.md"}