dotansimha / graphql-code-generator

A tool for generating code based on a GraphQL schema and GraphQL operations (query/mutation/subscription), with flexible support for custom plugins.
https://the-guild.dev/graphql/codegen/
MIT License
10.72k stars 1.31k forks source link

Fragment match export name #9982

Open flippidippi opened 1 month ago

flippidippi commented 1 month ago

Is your feature request related to a problem? Please describe.

Currently, we can't smoothly have fragment-matcher run with the other plugins like typescript etc, because fragement-matcher exports the possible types as default.

Describe the solution you'd like

Ability to override the default export, or a setting that exports it with a specific name, like export possibleTypes

https://github.com/dotansimha/graphql-code-generator/blob/21fbf0db2ba7a560aeb0aa52e9b9bf792ac94227/packages/plugins/other/fragment-matcher/src/index.ts#L227

Describe alternatives you've considered

For now I'm just importing it as default

Is your feature request related to a problem? Please describe.

Combining fragment-matcher with other plugins isn't the best experience