dotansimha / dotansimha/graphql-code-generator
Map field to a type
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 23
Description
### Is your feature request related to a problem? Please describe.
I have an ObjectType in my schema:
```graphql
type SomeObj implements Node {
id: ID!
}
```
In TS Codegen I'd like to map `SomeObj.id` to a specific type `type SomeObjId = string` as I'm trying avoid mixing different ids on TS level.
So the result in codegen-generated file would be this:
```diff
export type SomeObj = {
- readonly id: Scalars['ID']['output'];
+ readonly id: TagId;
```
I tried creating custom scalar `SomeObjID` on schema level but that breaks `Node` interface contract so cannot do that.
### Describe the solution you'd like
Is there a way to map such field?
### Describe alternatives you've considered
_No response_
### Is your feature request related to a problem? Please describe.
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.