When I specify fetcher option with a custom path to my function and useTypeImports with a value of true in the generation settings, the generated files import my function with the type import modifier, which causes TypeScript to fail and the application to build.
See on import of import type { fetcher } from './custom-fetcher'
Expected behavior
As a user I am expected that import path will be import { fetcher } from './custom-fetcher' with option useTypeImports: true, because fetcher is a function, but not type or interface.
Which packages are impacted by your issue?
@graphql-codegen/typescript-react-query
Describe the bug
When I specify
fetcher
option with a custom path to my function anduseTypeImports
with a value oftrue
in the generation settings, the generated files import my function with thetype
import modifier, which causes TypeScript to fail and the application to build.Your Example Website or App
https://stackblitz.com/edit/github-djwd6w?file=codegen.ts
Steps to Reproduce the Bug or Issue
npm run generate
types.ts
fileimport type { fetcher } from './custom-fetcher'
Expected behavior
As a user I am expected that import path will be
import { fetcher } from './custom-fetcher'
with optionuseTypeImports: true
, becausefetcher
is a function, but not type or interface.Screenshots or Videos
No response
Platform
graphql
version: 16.9.0@graphql-codegen/typescript-react-query
version: 6.1.0Codegen Config File
Additional context
No response