-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migration from apollo:codegen
to typescript-operations
#6344
Comments
@Nicoowr |
I see, then is there any way to generate one file per operation? I checked the |
GraphQL Codegen and Apollo Codegen have different goals. While GraphQL Codegen plugins aim to generate output that could work with any client/server, the Apollo Codegen is specific to the Apollo ecosystem and their client. We are not generating sub-types for each selection set (we had that in older versions, and it caused conflicts and types bloat). In specific cases where you with to get sub-types, you can use GraphQL fragments, and codegen will generate a type for each fragment. Also, you can use this as a comparison / migration guide: apollographql/apollo-tooling#2053 |
Very clear, thanks for your insight! |
Is your feature request related to a problem? Please describe.
We are generating types from graphql operations with
apollo:codegen
, but we'd like to migrate tographql-codegen
. However, the structure of generated types is very different between both, which would require a big change in our codebase if we wanted to migrate. For instance:graphql-codegen
, instead of multiple files inapollo:codegen
Another thing to note is that it's possible to use subtypes in those generated by apollo.
Describe the solution you'd like
I'd like to be able to reproduce the shape of generated types in apollo:codegen with graphql-codegen.
Describe alternatives you've considered
Refactor my whole codebase, but it'd be awesome if there was an alternative...
In any case, thanks for your awesome tool !!
The text was updated successfully, but these errors were encountered: