-
I am using nestJS, I want my front end react queries with apollo to be typed out, but no configuration is working. I assume because Pothos actually builds your schema and it itself isn't a schema. My question is how do I make the TypeScript with Apollo Client code gen work? My entire pothos schema is in my I have tried the following configurations:Apollos recommendationLink Above import { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
schema: 'http://localhost:3000/api',
documents: ['*.ts'],
generates: {
'./src/__generated__/': {
preset: 'client',
plugins: [],
presetConfig: {
gqlTagName: 'gql',
}
}
},
ignoreNoDocuments: true,
};
export default config; the guilds recomendationimport type { CodegenConfig } from '@graphql-codegen/cli'
const config: CodegenConfig = {
// ...
generates: {
'path/to/file.ts': {
plugins: ['typescript', 'typescript-operations', 'typescript-react-apollo'],
config: {
reactApolloVersion: 3
}
}
}
}
export default config combination of the twoimport { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
schema: 'http://localhost:3000/api',
documents: ['*.ts'],
generates: {
'pages/api/index.ts': {
plugins: ['typescript', 'typescript-operations', 'typescript-react-apollo'],
config: {
reactApolloVersion: 3
}
}
},
ignoreNoDocuments: true,
};
export default config; |
Beta Was this translation helpful? Give feedback.
Answered by
hayes
Dec 2, 2022
Replies: 1 comment 10 replies
-
can you provide a little more detail on what is actually failing? In general there are 3 options for using pothos with graphql-codegen:
|
Beta Was this translation helpful? Give feedback.
10 replies
Answer selected by
hayes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can you provide a little more detail on what is actually failing?
In general there are 3 options for using pothos with graphql-codegen:
schema: 'http://localhost:3000/api',