Closed jaminhaber closed 1 month ago
Hi @jaminhaber,
typescript-resolvers plugin has a option called mappers that should do what you want.
However, setting mappers
for every type that need mapping can be tedious and eventually lead to a really large config file which is hard to manage.
It's our recommendation to use Server Preset (guide) as it can make development a lot easier. Just to name a few benefits:
Closing this as there's options. Please let me know if my suggestions don't work for your use case @jaminhaber 🙂
Generating accurate types for resolved fields is still an unsolved problem, even if it is known which fields are resolved vs not. (Similar to the issue raised here: https://github.com/dotansimha/graphql-code-generator/issues/1780)
when using GQL code generator to generate resolver types for an api from a schema file, resolved fields are still declared on parent objects and must be stubbed or otherwise overridden.
example:
would require something like this:
Describe the solution you'd like
Is it possible to make a config that can override fields based on directives?
scenario 1
An explicit config field for this behavior for this use case
scenario 2
A generic config to modify types based on directives
Would result in something like this