Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only enums are generated #880

Open
Sam-Kruglov opened this issue Nov 17, 2024 · 1 comment
Open

Only enums are generated #880

Sam-Kruglov opened this issue Nov 17, 2024 · 1 comment
Labels
good first issue Good for newcomers

Comments

@Sam-Kruglov
Copy link

I only see these imports:

import { z } from 'zod'
import { AccountType, ErrorClassification, PaymentStatus } from './graphql'

But I don't see anything else, like this for example:

export type SubmitPaymentMutationVariables = Exact<{
  accountId: Scalars['ID']['input'];
  amount: Scalars['String']['input'];
}>;

Config:

import { CodegenConfig } from '@graphql-codegen/cli'

const config: CodegenConfig = {
  schema: [
    {
      [process.env.NEXT_PUBLIC_GRAPHQL_URL_SCHEMA as string]: {
        // @ts-ignore https://github.com/dotansimha/graphql-code-generator/issues/9309
        handleAsSDL: true,
        method: 'GET'
      }
    }
  ],
  documents: ['data/**/*.ts'],
  ignoreNoDocuments: true,
  generates: {
    './data/graphql/generated/': {
      preset: 'client',
      config: {
        strictScalars: true,
        scalars: {
          ID: 'string'
        }
      }
    },
    './data/graphql/generated/graphql.zod.ts': {
      plugins: ['typescript-validation-schema'],
      config: {
        importFrom: './graphql',
        schema: 'zod',
        strictScalars: true,
        scalars: {
          ID: 'string'
        }
      }
    }
  }
}

export default config
@github-actions github-actions bot added the good first issue Good for newcomers label Nov 17, 2024
@Sam-Kruglov
Copy link
Author

I did consider the workaround, even slightly modifying to be exactly like in #303 but it's the same. Also tried yup but also the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant