graphql-code-generator-community
graphql-code-generator-community copied to clipboard
[near-operation-file] Option to name generated files after operations instead of .grapqhl filenames
Is your feature request related to a problem? Please describe.
We're looking at migrating from Apollo CLI for codegen. With Apollo, generated files are named after the operation defined in the GraphQL file. With graphql-code-generator and the near-operation-file preset, it looks like the generated files are always named after the source file name.
Describe the solution you'd like
It would be great to have an option to name the generated file after the operation, instead of after the source file, when using the near-operation-file preset.
Describe alternatives you've considered
Alternatives are to remain on the deprecated Apollo codegen, or go through our project and rename a lot of imports (possibly writing a codemod for it). I'm sure many other users are facing a similar situation.
Additional context
Thanks for working on this library!