Closed yshrsmz closed 10 months ago
In the meantime we can use add
plugin to prepend the import statement.
plugins: [
'typescript-operations',
'typescript-graphql-request',
{
add: {
content: [
'/* eslint-disable */',
`import type { GraphQLError } from 'graphql'`,
],
},
},
],
Which packages are impacted by your issue?
@graphql-codegen/typescript-graphql-request
Describe the bug
Generated code uses
GraphQLError
without importing it.Your Example Website or App
https://stackblitz.com/edit/github-jjt8y7?file=types.ts%3AL61
Steps to Reproduce the Bug or Issue
Please refer to the
types.ts
in the repro. In line 62, you can seeGraphQLError
used but no import for it.Expected behavior
There should be a import statement for
GraphQLError
Screenshots or Videos
Platform
graphql
version: 16.8.1@graphql-codegen/tyepscript-graphql-request
version: 6.0.0Codegen Config File
Additional context
No response