generating only the necessary part of the schema #9099
-
Hi, codegen.ts import { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
schema: '../router/supergraph-schema.graphql',
documents: ['./src/gql_definitions/queries.ts'],
ignoreNoDocuments: true,
generates: {
'./src/gql/': {
preset: 'client',
plugins: [],
},
},
};
export default config; My query is; import { graphql } from '../gql/gql';
export const CITY = graphql(`
query City($cityId: Int!) {
city(id: $cityId) {
id
name
population
}
}
`); finally, below files created successfully;
However, all the super schema entities are generated in Is it possible to generate only the needed part of the schema? Here we use city query & need only related types to this query. I love graphql codegenerator, thank you all for it 😄 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is already on the roadmap. #8296 |
Beta Was this translation helpful? Give feedback.
This is already on the roadmap. #8296