{"_id":"@acaldas/graphql-codegen-typescript-validation-schema","_rev":"4-d8de46f1cc419d29b6ef50f6fb9b69e8","name":"@acaldas/graphql-codegen-typescript-validation-schema","dist-tags":{"latest":"0.12.4"},"versions":{"0.12.1":{"name":"@acaldas/graphql-codegen-typescript-validation-schema","version":"0.12.1","keywords":["gql","generator","yup","zod","code","types","graphql","codegen","apollo","node","types","typings"],"author":{"name":"codehex"},"license":"MIT","_id":"@acaldas/graphql-codegen-typescript-validation-schema@0.12.1","maintainers":[{"name":"acaldas","email":"afonso7caldas@gmail.com"}],"bugs":{"url":"https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema/issues"},"dist":{"shasum":"31f90a42acb5ad981552767c383b9d2aab3462ec","tarball":"https://registry.npmjs.org/@acaldas/graphql-codegen-typescript-validation-schema/-/graphql-codegen-typescript-validation-schema-0.12.1.tgz","fileCount":46,"integrity":"sha512-AxdURL7ZSbf8Szm8XnQxXHRix4x1KWi/svcxxzvhoVS0OrMge8iQVl12oymdDBT2nL8xgGtb43SH81frK9FE9g==","signatures":[{"sig":"MEUCICYeK/DTGoi13NWvC++OknnWpptJTUgD76DByyA6eKuuAiEA5bFu8z88uPoPQ0rRe5S3f95yYsNR7C5MudB2DWUInw0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":133275},"main":"dist/main/index.js","module":"dist/module/index.js","scripts":{"lint":"eslint --ext .ts .","test":"vitest run","build":"run-p build:*","generate":"run-p build:* && graphql-codegen","lint-fix":"eslint --fix --ext .ts .","prettier":"prettier --write --list-different \"**/*.{ts,graphql,yml}\"","build:main":"tsc -p tsconfig.main.json","preinstall":"npx only-allow pnpm","prepublish":"run-p build:*","type-check":"tsc --noEmit","build:module":"tsc -p tsconfig.module.json","prettier:check":"prettier --check \"**/*.{ts,graphql,yml}\"","type-check:yup":"tsc --strict --noEmit example/yup/schemas.ts","type-check:zod":"tsc --strict --noEmit example/zod/schemas.ts","type-check:myzod":"tsc --strict --noEmit example/myzod/schemas.ts"},"typings":"dist/main/index.d.ts","_npmUser":{"name":"acaldas","email":"afonso7caldas@gmail.com"},"description":"GraphQL Code Generator plugin to generate form validation schema from your GraphQL schema","directories":{},"licenseText":"MIT License\n\nCopyright (c) 2022 codehex\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","respository":{"url":"https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema.git","type":"git"},"dependencies":{"graphql":"^16.8.0","graphlib":"^2.1.8","@graphql-tools/utils":"^10.0.0","@graphql-codegen/schema-ast":"4.0.0","@graphql-codegen/plugin-helpers":"^5.0.0","@graphql-codegen/visitor-plugin-common":"^4.0.0"},"_hasShrinkwrap":false,"devDependencies":{"yup":"1.2.0","zod":"3.22.2","jest":"29.6.4","myzod":"1.10.1","eslint":"8.48.0","vitest":"^0.34.1","ts-jest":"29.1.1","prettier":"3.0.3","ts-dedent":"^2.2.0","typescript":"5.2.2","@types/jest":"29.5.4","@types/node":"^18.17.5","npm-run-all":"4.1.5","@types/graphlib":"^2.1.8","@graphql-codegen/cli":"5.0.0","eslint-plugin-import":"^2.27.5","@tsconfig/recommended":"1.0.2","@typescript-eslint/parser":"6.5.0","@graphql-codegen/typescript":"^4.0.0","@typescript-eslint/eslint-plugin":"6.5.0","eslint-plugin-simple-import-sort":"^10.0.0"},"peerDependencies":{"graphql":"^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/graphql-codegen-typescript-validation-schema_0.12.1_1693830104653_0.2608847081757615","host":"s3://npm-registry-packages"}},"0.12.2":{"name":"@acaldas/graphql-codegen-typescript-validation-schema","version":"0.12.2","keywords":["gql","generator","yup","zod","code","types","graphql","codegen","apollo","node","types","typings"],"author":{"name":"codehex"},"license":"MIT","_id":"@acaldas/graphql-codegen-typescript-validation-schema@0.12.2","maintainers":[{"name":"acaldas","email":"afonso7caldas@gmail.com"}],"bugs":{"url":"https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema/issues"},"dist":{"shasum":"59cbf3b6321e100964f4aa6764ea72ef51b032c5","tarball":"https://registry.npmjs.org/@acaldas/graphql-codegen-typescript-validation-schema/-/graphql-codegen-typescript-validation-schema-0.12.2.tgz","fileCount":46,"integrity":"sha512-VovshRQmATakaf/zQbsXhuSBoTn+sJZq5BON3yrVo++RU8Nl0w/D9QVxV0nxcJVpuilFi57cH7lJSkqPRMt5Wg==","signatures":[{"sig":"MEUCIQCGjSRl0UdJ7xJb8PDNC18Ue3BJXBOQ3irsuFxzmFupmgIgdaGkY3kf5lCnx1yWAtb9gwFv40bCdHNmvg7KyDZZOuI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":133231},"main":"dist/main/index.js","module":"dist/module/index.js","scripts":{"lint":"eslint --ext .ts .","test":"vitest run","build":"run-p build:*","generate":"run-p build:* && graphql-codegen","lint-fix":"eslint --fix --ext .ts .","prettier":"prettier --write --list-different \"**/*.{ts,graphql,yml}\"","build:main":"tsc -p tsconfig.main.json","preinstall":"npx only-allow pnpm","prepublish":"run-p build:*","type-check":"tsc --noEmit","build:module":"tsc -p tsconfig.module.json","prettier:check":"prettier --check \"**/*.{ts,graphql,yml}\"","type-check:yup":"tsc --strict --noEmit example/yup/schemas.ts","type-check:zod":"tsc --strict --noEmit example/zod/schemas.ts","type-check:myzod":"tsc --strict --noEmit example/myzod/schemas.ts"},"typings":"dist/main/index.d.ts","_npmUser":{"name":"acaldas","email":"afonso7caldas@gmail.com"},"description":"GraphQL Code Generator plugin to generate form validation schema from your GraphQL schema","directories":{},"licenseText":"MIT License\n\nCopyright (c) 2022 codehex\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","respository":{"url":"https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema.git","type":"git"},"dependencies":{"graphlib":"^2.1.8","@graphql-tools/utils":"^10.0.0","@graphql-codegen/schema-ast":"4.0.0","@graphql-codegen/plugin-helpers":"^5.0.0","@graphql-codegen/visitor-plugin-common":"^4.0.0"},"_hasShrinkwrap":false,"devDependencies":{"yup":"1.2.0","zod":"3.22.2","jest":"29.6.4","myzod":"1.10.1","eslint":"8.48.0","vitest":"^0.34.1","graphql":"^16.8.0","ts-jest":"29.1.1","prettier":"3.0.3","ts-dedent":"^2.2.0","typescript":"5.2.2","@types/jest":"29.5.4","@types/node":"^18.17.5","npm-run-all":"4.1.5","@types/graphlib":"^2.1.8","@graphql-codegen/cli":"5.0.0","eslint-plugin-import":"^2.27.5","@tsconfig/recommended":"1.0.2","@typescript-eslint/parser":"6.5.0","@graphql-codegen/typescript":"^4.0.0","@typescript-eslint/eslint-plugin":"6.5.0","eslint-plugin-simple-import-sort":"^10.0.0"},"peerDependencies":{"graphql":"^16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/graphql-codegen-typescript-validation-schema_0.12.2_1693837988445_0.12352119439127462","host":"s3://npm-registry-packages"}},"0.12.3":{"name":"@acaldas/graphql-codegen-typescript-validation-schema","version":"0.12.3","keywords":["gql","generator","yup","zod","code","types","graphql","codegen","apollo","node","types","typings"],"author":{"name":"codehex"},"license":"MIT","_id":"@acaldas/graphql-codegen-typescript-validation-schema@0.12.3","maintainers":[{"name":"acaldas","email":"afonso7caldas@gmail.com"}],"bugs":{"url":"https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema/issues"},"dist":{"shasum":"1d2b4705784982aafc80dc222e536b8cbe93daa4","tarball":"https://registry.npmjs.org/@acaldas/graphql-codegen-typescript-validation-schema/-/graphql-codegen-typescript-validation-schema-0.12.3.tgz","fileCount":46,"integrity":"sha512-NVH7QS/jCO2X3hSe5qeFgdPms6J9eUHt9ZHirt/KJ6liqo4jTdN0xJO0Dns0bdSBwqsuzNuRNrQmpYNpC3zlOQ==","signatures":[{"sig":"MEUCICmhOe3ZTRCoRqBjllQmWIxyd62GHQkoR5hF+D8wW/VwAiEA4Uu522gs67SWbHt0T3YppIn7W0pviwlZjEEsTjB51Mc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":133429},"main":"dist/main/index.js","module":"dist/module/index.js","scripts":{"lint":"eslint --ext .ts .","test":"vitest run","build":"run-p build:*","generate":"run-p build:* && graphql-codegen","lint-fix":"eslint --fix --ext .ts .","prettier":"prettier --write --list-different \"**/*.{ts,graphql,yml}\"","build:main":"tsc -p tsconfig.main.json","preinstall":"npx only-allow pnpm","prepublish":"run-p build:*","type-check":"tsc --noEmit","build:module":"tsc -p tsconfig.module.json","prettier:check":"prettier --check \"**/*.{ts,graphql,yml}\"","type-check:yup":"tsc --strict --noEmit example/yup/schemas.ts","type-check:zod":"tsc --strict --noEmit example/zod/schemas.ts","type-check:myzod":"tsc --strict --noEmit example/myzod/schemas.ts"},"typings":"dist/main/index.d.ts","_npmUser":{"name":"acaldas","email":"afonso7caldas@gmail.com"},"description":"GraphQL Code Generator plugin to generate form validation schema from your GraphQL schema","directories":{},"licenseText":"MIT License\n\nCopyright (c) 2022 codehex\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","respository":{"url":"https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema.git","type":"git"},"dependencies":{"graphlib":"^2.1.8","@graphql-tools/utils":"^10.0.0","@graphql-codegen/schema-ast":"4.0.0","@graphql-codegen/plugin-helpers":"^5.0.0","@graphql-codegen/visitor-plugin-common":"^4.0.0"},"_hasShrinkwrap":false,"devDependencies":{"yup":"1.2.0","zod":"3.22.2","jest":"29.6.4","myzod":"1.10.1","eslint":"8.48.0","vitest":"^0.34.1","graphql":"^16.8.0","ts-jest":"29.1.1","prettier":"3.0.3","ts-dedent":"^2.2.0","typescript":"5.2.2","@types/jest":"29.5.4","@types/node":"^18.17.5","npm-run-all":"4.1.5","@types/graphlib":"^2.1.8","@graphql-codegen/cli":"5.0.0","eslint-plugin-import":"^2.27.5","@tsconfig/recommended":"1.0.2","@typescript-eslint/parser":"6.5.0","@graphql-codegen/typescript":"^4.0.0","@typescript-eslint/eslint-plugin":"6.5.0","eslint-plugin-simple-import-sort":"^10.0.0"},"peerDependencies":{"graphql":"^16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/graphql-codegen-typescript-validation-schema_0.12.3_1693838665153_0.7603888832708396","host":"s3://npm-registry-packages"}},"0.12.4":{"name":"@acaldas/graphql-codegen-typescript-validation-schema","version":"0.12.4","description":"GraphQL Code Generator plugin to generate form validation schema from your GraphQL schema","respository":{"type":"git","url":"https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema.git"},"main":"dist/main/index.js","typings":"dist/main/index.d.ts","module":"dist/module/index.js","scripts":{"type-check":"tsc --noEmit","type-check:yup":"tsc --strict --noEmit example/yup/schemas.ts","type-check:zod":"tsc --strict --noEmit example/zod/schemas.ts","type-check:myzod":"tsc --strict --noEmit example/myzod/schemas.ts","test":"vitest run","build":"run-p build:*","build:main":"tsc -p tsconfig.main.json","build:module":"tsc -p tsconfig.module.json","lint":"eslint --ext .ts .","lint-fix":"eslint --fix --ext .ts .","prettier":"prettier --write --list-different \"**/*.{ts,graphql,yml}\"","prettier:check":"prettier --check \"**/*.{ts,graphql,yml}\"","generate":"run-p build:* && graphql-codegen","prepublish":"run-p build:*"},"keywords":["gql","generator","yup","zod","code","types","graphql","codegen","apollo","node","types","typings"],"author":{"name":"codehex"},"license":"MIT","devDependencies":{"@graphql-codegen/cli":"5.0.0","@graphql-codegen/typescript":"^4.0.0","@tsconfig/recommended":"1.0.2","@types/graphlib":"^2.1.8","@types/jest":"29.5.4","@types/node":"^18.17.5","@typescript-eslint/eslint-plugin":"6.5.0","@typescript-eslint/parser":"6.5.0","eslint":"8.48.0","eslint-plugin-import":"^2.27.5","eslint-plugin-simple-import-sort":"^10.0.0","graphql":"^16.11.0","jest":"29.6.4","myzod":"1.10.1","npm-run-all":"4.1.5","prettier":"3.0.3","ts-dedent":"^2.2.0","ts-jest":"29.1.1","typescript":"5.2.2","vitest":"^0.34.1","yup":"1.2.0","zod":"3.22.2"},"dependencies":{"@graphql-codegen/plugin-helpers":"^5.0.0","@graphql-codegen/schema-ast":"4.0.0","@graphql-codegen/visitor-plugin-common":"^4.0.0","@graphql-tools/utils":"^10.0.0","graphlib":"^2.1.8"},"bugs":{"url":"https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema/issues"},"peerDependencies":{"graphql":"^16.11.0"},"_id":"@acaldas/graphql-codegen-typescript-validation-schema@0.12.4","gitHead":"ed02e5c0927739c9405223619d1b56213817b297","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-BsoF3lXeMlfm3wrjdbEpm20H4FKhtKRt5DNdC9ESY+h2hUCw+s1tANfIPGNQPS6O5MguFL07cOsIGE/t+5iU9A==","shasum":"9f1e56072f948ee7e32df364ab341ad1f9cf0d19","tarball":"https://registry.npmjs.org/@acaldas/graphql-codegen-typescript-validation-schema/-/graphql-codegen-typescript-validation-schema-0.12.4.tgz","fileCount":36,"unpackedSize":133390,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDhTbsKo8hXwYm4ms4V6Zf1qc8/lRNEbAwMxPNzJppM2gIgClFn05FUEi8pXYThjNf1A7sdtIESsuV1HMZZTWXgqBY="}]},"_npmUser":{"name":"acaldas","email":"afonso7caldas@gmail.com"},"directories":{},"maintainers":[{"name":"acaldas","email":"afonso7caldas@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/graphql-codegen-typescript-validation-schema_0.12.4_1760549315947_0.8960517883887231"},"_hasShrinkwrap":false}},"time":{"created":"2023-09-04T12:21:44.524Z","modified":"2025-10-15T17:28:36.303Z","0.12.1":"2023-09-04T12:21:44.844Z","0.12.2":"2023-09-04T14:33:08.602Z","0.12.3":"2023-09-04T14:44:25.359Z","0.12.4":"2025-10-15T17:28:36.118Z"},"bugs":{"url":"https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema/issues"},"author":{"name":"codehex"},"license":"MIT","keywords":["gql","generator","yup","zod","code","types","graphql","codegen","apollo","node","types","typings"],"description":"GraphQL Code Generator plugin to generate form validation schema from your GraphQL schema","maintainers":[{"name":"acaldas","email":"afonso7caldas@gmail.com"}],"readme":"# graphql-codegen-typescript-validation-schema\n\n[![Test](https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema/actions/workflows/ci.yml/badge.svg)](https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema/actions/workflows/ci.yml) [![npm version](https://badge.fury.io/js/graphql-codegen-typescript-validation-schema.svg)](https://badge.fury.io/js/graphql-codegen-typescript-validation-schema)\n\n[GraphQL code generator](https://github.com/dotansimha/graphql-code-generator) plugin to generate form validation schema from your GraphQL schema.\n\n- [x] support [yup](https://github.com/jquense/yup)\n- [x] support [zod](https://github.com/colinhacks/zod)\n- [x] support [myzod](https://github.com/davidmdm/myzod)\n\n## Quick Start\n\nStart by installing this plugin and write simple plugin config;\n\n```sh\n$ npm i graphql-codegen-typescript-validation-schema\n```\n\n```yml\ngenerates:\n  path/to/graphql.ts:\n    plugins:\n      - typescript\n      - typescript-validation-schema # specify to use this plugin\n    config:\n      # You can put the config for typescript plugin here\n      # see: https://www.graphql-code-generator.com/plugins/typescript\n      strictScalars: true\n      # Overrides built-in ID scalar to both input and output types as string.\n      # see: https://the-guild.dev/graphql/codegen/plugins/typescript/typescript#scalars\n      scalars:\n        ID: string\n      # You can also write the config for this plugin together\n      schema: yup # or zod\n```\n\nIt is recommended to write `scalars` config for built-in type `ID`, as in the yaml example shown above. For more information: [#375](https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema/pull/375)\n\nYou can check [example](https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema/tree/main/example) directory if you want to see more complex config example or how is generated some files.\n\nThe Q&A for each schema is written in the README in the respective example directory.\n\n## Config API Reference\n\n### `schema`\n\ntype: `ValidationSchema` default: `'yup'`\n\nSpecify generete validation schema you want.\n\nYou can specify `yup` or `zod` or `myzod`.\n\n```yml\ngenerates:\n  path/to/graphql.ts:\n    plugins:\n      - typescript\n      - typescript-validation-schema\n    config:\n      schema: yup\n```\n\n### `importFrom`\n\ntype: `string`\n\nWhen provided, import types from the generated typescript types file path. if not given, omit import statement.\n\n```yml\ngenerates:\n  path/to/graphql.ts:\n    plugins:\n      - typescript\n  path/to/validation.ts:\n    plugins:\n      - typescript-validation-schema\n    config:\n      importFrom: ./graphql # path for generated ts code\n```\n\nThen the generator generates code with import statement like below.\n\n```ts\nimport { GeneratedInput } from './graphql'\n\n/* generates validation schema here */\n```\n\n### `useTypeImports`\n\ntype: `boolean` default: `false`\n\nWill use `import type {}` rather than `import {}` when importing generated TypeScript types.\nThis gives compatibility with TypeScript's \"importsNotUsedAsValues\": \"error\" option.\nShould used in conjunction with `importFrom` option.\n\n### `typesPrefix`\n\ntype: `string` default: (empty)\n\nPrefixes all import types from generated typescript type.\n\n```yml\ngenerates:\n  path/to/graphql.ts:\n    plugins:\n      - typescript\n  path/to/validation.ts:\n    plugins:\n      - typescript-validation-schema\n    config:\n      typesPrefix: I\n      importFrom: ./graphql # path for generated ts code\n```\n\nThen the generator generates code with import statement like below.\n\n```ts\nimport { IGeneratedInput } from './graphql'\n\n/* generates validation schema here */\n```\n\n### `typesSuffix`\n\ntype: `string` default: (empty)\n\nSuffixes all import types from generated typescript type.\n\n```yml\ngenerates:\n  path/to/graphql.ts:\n    plugins:\n      - typescript\n  path/to/validation.ts:\n    plugins:\n      - typescript-validation-schema\n    config:\n      typesSuffix: I\n      importFrom: ./graphql # path for generated ts code\n```\n\nThen the generator generates code with import statement like below.\n\n```ts\nimport { GeneratedInputI } from './graphql'\n\n/* generates validation schema here */\n```\n\n### `enumsAsTypes`\n\ntype: `boolean` default: `false`\n\nGenerates enum as TypeScript `type` instead of `enum`.\n\n### `notAllowEmptyString`\n\ntype: `boolean` default: `false`\n\nGenerates validation string schema as do not allow empty characters by default.\n\n### `scalarSchemas`\n\ntype: `ScalarSchemas`\n\nExtends or overrides validation schema for the built-in scalars and custom GraphQL scalars.\n\n#### yup schema\n\n```yml\nconfig:\n  schema: yup\n  scalarSchemas:\n    Date: yup.date()\n    Email: yup.string().email()\n```\n\n#### zod schema\n\n```yml\nconfig:\n  schema: zod\n  scalarSchemas:\n    Date: z.date()\n    Email: z.string().email()\n```\n\n### `withObjectType`\n\ntype: `boolean` default: `false`\n\nGenerates validation schema with GraphQL type objects. But excludes `Query`, `Mutation`, `Subscription` objects.\n\nIt is currently added for the purpose of using simple objects. See also [#20](https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema/issues/20#issuecomment-1058969191), [#107](https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema/issues/107).\n\nThis option currently **does not support fragment** generation. If you are interested, send me PR would be greatly appreciated!\n\n### `validationSchemaExportType`\n\ntype: `ValidationSchemaExportType` default: `'function'`\n\nSpecify validation schema export type.\n\n### `directives`\n\ntype: `DirectiveConfig`\n\nGenerates validation schema with more API based on directive schema. For example, yaml config and GraphQL schema is here.\n\n```graphql\ninput ExampleInput {\n  email: String! @required(msg: \"Hello, World!\") @constraint(minLength: 50, format: \"email\")\n  message: String! @constraint(startsWith: \"Hello\")\n}\n```\n\n#### yup schema\n\n```yml\ngenerates:\n  path/to/graphql.ts:\n    plugins:\n      - typescript\n      - typescript-validation-schema\n    config:\n      schema: yup\n      directives:\n        # Write directives like\n        #\n        # directive:\n        #   arg1: schemaApi\n        #   arg2: [\"schemaApi2\", \"Hello $1\"]\n        #\n        # See more examples in `./tests/directive.spec.ts`\n        # https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema/blob/main/tests/directive.spec.ts\n        required:\n          msg: required\n        constraint:\n          minLength: min\n          # Replace $1 with specified `startsWith` argument value of the constraint directive\n          startsWith: [\"matches\", \"/^$1/\"]\n          format:\n            email: email\n```\n\nThen generates yup validation schema like below.\n\n```ts\nexport function ExampleInputSchema(): yup.SchemaOf<ExampleInput> {\n  return yup.object({\n    email: yup.string().defined().required(\"Hello, World!\").min(50).email(),\n    message: yup.string().defined().matches(/^Hello/)\n  })\n}\n```\n\n#### zod schema\n\n```yml\ngenerates:\n  path/to/graphql.ts:\n    plugins:\n      - typescript\n      - typescript-validation-schema\n    config:\n      schema: zod\n      directives:\n        # Write directives like\n        #\n        # directive:\n        #   arg1: schemaApi\n        #   arg2: [\"schemaApi2\", \"Hello $1\"]\n        #\n        # See more examples in `./tests/directive.spec.ts`\n        # https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema/blob/main/tests/directive.spec.ts\n        constraint:\n          minLength: min\n          # Replace $1 with specified `startsWith` argument value of the constraint directive\n          startsWith: [\"regex\", \"/^$1/\", \"message\"]\n          format:\n            email: email\n```\n\nThen generates zod validation schema like below.\n\n```ts\nexport function ExampleInputSchema(): z.ZodSchema<ExampleInput> {\n  return z.object({\n    email: z.string().min(50).email(),\n    message: z.string().regex(/^Hello/, \"message\")\n  })\n}\n```\n\n#### other schema\n\nPlease see [example](https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema/tree/main/example) directory.\n\n## Notes\n\nTheir is currently a compatibility issue with the client-preset. A workaround for this is to split the generation into two (one for client-preset and one for typescript-validation-schema).\n\n```yml\ngenerates:\n  path/to/graphql.ts:\n    plugins:\n      - typescript-validation-schema\n  /path/to/graphql/:\n    preset: 'client',\n      plugins:\n      ...\n```","readmeFilename":"README.md"}