Types are generated twice in v3, making them all duplicated. #8996
Answered
by
n1ru4l
PhilipAngelinNE
asked this question in
Q&A
-
|
Title. In previous v2 versions there were no issues with duplicate types, but now when trying v3 it happens. This is the config: import type { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
schema: 'http://localhost:11500/graphql',
documents: 'api/queries/**/*.graphql',
ignoreNoDocuments: true,
generates: {
'api/gql/': {
preset: 'client',
plugins: ['typescript'],
config: {
maybeValue: 'T | null | undefined',
},
},
},
};
export default config;Anyone else who's run into this issue? In v3? I found one other thread but that was using the yml config, which worked, so doesn't help here sadly. |
Beta Was this translation helpful? Give feedback.
Answered by
n1ru4l
Feb 16, 2023
Replies: 1 comment 2 replies
-
|
Hey, @PhilipAngelinNE You should remove the import type { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
schema: 'http://localhost:11500/graphql',
documents: 'api/queries/**/*.graphql',
ignoreNoDocuments: true,
generates: {
'api/gql/': {
preset: 'client',
- plugins: ['typescript'],
+ plugins: [],
config: {
maybeValue: 'T | null | undefined',
},
},
},
};
export default config; |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
n1ru4l
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, @PhilipAngelinNE You should remove the
'typescript'plugin from thepluginsarray. The client preset already automatically applies this plugin.import type { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { schema: 'http://localhost:11500/graphql', documents: 'api/queries/**/*.graphql', ignoreNoDocuments: true, generates: { 'api/gql/': { preset: 'client', - plugins: ['typescript'], + plugins: [], config: { maybeValue: 'T | null | undefined', }, }, }, }; export default config;