Catch the highlights of GraphQLConf 2023! Click for recordings. Or check out our recap blog post.

TypeScript Validation Schema

Package nameWeekly DownloadsVersionLicenseUpdated
graphql-codegen-typescript-validation-schemaDownloadsVersionLicenseAug 13th, 2023


npm i -D graphql-codegen-typescript-validation-schema

Built and maintained by Code-Hex

A plugin for GraphQL Codegen to generate form validation schema (such as yup, zod) based on your GraphQL schema for use in a client application.


Set up your project per the GraphQL Codegen Docs, and specify this plugin in your codegen.yml:

import type { CodegenConfig } from '@graphql-codegen/cli'
const config: CodegenConfig = {
  generates: {
    'path/to/graphql.ts': {
      plugins: ['typescript', 'typescript-validation-schema'],
      config: {
        strictScalars: true,
        schema: 'yup'
export default config

Usage & Documentation

For the complete documentation, please refer to Code-Hex/graphql-codegen-typescript-validation-schema repository.