graphql-code-generator icon indicating copy to clipboard operation
graphql-code-generator copied to clipboard

Typescript Resolvers Plugin: Ability to provide a custom visitor

Open dac09 opened this issue 3 years ago • 1 comments

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

dac09 avatar Sep 08 '22 12:09 dac09

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.

Tobbe avatar Sep 08 '22 16:09 Tobbe