Is your feature request related to a problem? Please describe.
Some tools such as Apollo Tooling generate files based on operation name.
Describe the solution you'd like
To make it easier to migrate from Apollo Tooling to Codegen, we could have an option to generate file name based on operation names.
Examples
// GraphQL Codegen detects gql in a React component:
------- ReactComponent.ts
...
const GET_FOO_QUERY = gql`
query GetFoo($id: String) {
...
}
`;
...
=========
// BEFORE: the generated filename is always based on the React component's filename:
------- ./__generated__/ReactComponent.ts
...
export type GetFooVariables = ...
export type GetFoo = ...
...
========
// AFTER: add a configuration option so the generated filename is based on the operation name (Query, Mutation, or Fragment):
------- ./__generated__/GetFoo.ts
...
export type GetFooVariables = ...
export type GetFoo = ...
Is your feature request related to a problem? Please describe.
Some tools such as Apollo Tooling generate files based on operation name.
Describe the solution you'd like
To make it easier to migrate from Apollo Tooling to Codegen, we could have an option to generate file name based on operation names.
Examples