graphql-code-generator
graphql-code-generator copied to clipboard
Typescript Resolvers Plugin: Ability to provide a custom visitor
In Redwood, we need the ability to slightly modify how the TypeScriptResolversVisitor works, while keeping all of the other functionality within the typescript-resolvers plugin as is.
Describe the solution you'd like Ability to pass a customResolver in the config via an import string
Describe alternatives you've considered
- passing visitor when we instantiate the plugin (but this does not match existing patterns of configuring codegen plugins
Additional context See draft PR for discussion
Describe alternatives you've considered
We've also considered calling the original typescript-resolver plugin (with the original visitor) as it is, and then calling our own visitor. And then trying to surgically replace specific parts of the output string from the original plugin with the output from our custom visitor. But it feels inefficient and prone to breaking when the output from the original plugin or visitor changes.