How to create alias for types?
Describe the bug I am unable to generate aliases for custom types. Here is a snippet from my schema:
type Author {
id: Id!
firstName: CustomType!
}
I want CustomType to be an alias of String. I tried adding scalars and primitives mappings in my codegen.yml file for CustomType, but that didn't work. I am still getting an error that says: Unknown type 'CustomType'.
Is it possible to alias standard GQL types? Also, are there any updated docs around the usage of scalars and primitives?
Hi @thunderousNinja ! It's not possible at the moment, but we are working on refactoring the typescript templates, and that's definitely a use-case we need to consider.
If you wish to override the type because you wish to get a resolvers signature, you can try to use typescript-resolvers plugin, and use generics or specify mappers configuration to override the links between the types.
@thunderousNinja Since 1.0.0, you can provide scalars and it will work :)