-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Which packages are impacted by your issue?
@graphql-codegen/visitor-plugin-common
Describe the bug
When setting useTypeImport and providing a custom fetcher, the import of the custom fetcher is wrong
It's an import type, like import type { fetcher } from '../fetcher';
instead of being a "non-type" import like import { fetcher } from '../fetcher';
This makes the code not working as the fetcher is not imported in the bundle.
I cannot turn of the useTypeImport option because I've verbatimModuleSyntax turned on in my tsconfig.
Your Example Website or App
https://stackblitz.com/edit/github-52kpkfnf?file=__generated__/graphql.ts
Steps to Reproduce the Bug or Issue
code is already generated so you can look at the __generated__/graphql.ts, but to reproduce it
npm i
npm run codegenExpected behavior
The import for the custom fetcher should never be a type import
Screenshots or Videos
No response
Platform
- OS: macOS
- NodeJS: 22
graphqlversion: 16.12.0@graphql-codegen/*version(s): 6.0.2@graphql-codegen/cli"^6.0.2",@graphql-codegen/typescript"^5.0.4",@graphql-codegen/typescript-operations"^5.0.4",@graphql-codegen/typescript-react-query"^6.1.1",
Codegen Config File
No response
Additional context
I believe the error is in the visitor-plugin-common, here but I may be completely wrong