I am using Apollo Client 3 and GraphQL Codegen.
I have the following query:
query Page($path: String!) {
page(path: $path) {
id
content {
...on PageOne {
id
description
}
...on PageTwo {
id
title
}
}
}
}
My codegen config file:
// codegen.ts
import type { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
schema: [
{
'https://my-endpoint.com': {
headers: {
'Introspection-Key': '8787667676867686678432',
},
},
},
],
documents: ['src/components/**/*.gql'],
generates: {
'src/graphql/generated/schema.ts': {
plugins: [
'typescript-common',
'typescript-client',
'typescript-react-apollo',
],
},
},
};
export default config;
Somehow GraphQL Codegen isn’t generating the specific fragment data types?