dotansimha / dotansimha/graphql-code-generator
typescript-resolvers, customResolveInfo does not follow useTypeImports setting
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 23
Description
### Which packages are impacted by your issue?
@graphql-codegen/typescript-resolvers
### Describe the bug
When using [customResolveInfo](https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-resolvers#customresolveinfo) with [useTypeImports](https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-resolvers#usetypeimports) enabled, it does not use `import type {}` as expected.
### Your Example Website or App
https://codesandbox.io/s/delicate-fire-ptrs7g?file=/types.ts:0-104
### Steps to Reproduce the Bug or Issue
In your codegen configuration enable both customResolveInfo and useTypeImports.
### Expected behavior
I expected the customResolveInfo import to be `import type {}` rather than `import {}`
### Screenshots or Videos
_No response_
### Platform
- `@graphql-codegen/typescript-resolvers` version(s): 2.7.12
### Codegen Config File
```
{
schema: "schema.graphql",
generates: {
"resolvers.ts": {
plugins: ["typescript", "typescript-resolvers"],
config: {
customResolveInfo:
"@apollo/cache-control-types#GraphQLResolveInfoWithCacheControl",
useTypeImports: true
}
}
}
};
```
### Additional context
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.