-
Notifications
You must be signed in to change notification settings - Fork 469
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
Generating flowtypes with a graphql input puts generated type in every generated file #988
Comments
I've had a look at the source code, and in particular the function It looks to me as though inputs and enums are treated as special cases, and are all always injected into every single generated file (as part of the Cheers! |
Any ideas on this? I'd be happy to look into it and potentially do a PR but would want to be sure it wasn't intentional behaviour first. |
I ran into this as well. I'd rather have a single file containing all of the enums and data types and have the query/mutation type files import whatever they need from that central schema type file. |
It looks like typescript codegen already has this functionality (it generates a Perhaps if |
Shoot, I was hoping that would work with flow, since the docs don't specify that it's typescript only. I'm migrating from Edit: oof, I see this has been attempted at least twice. #1224 |
Intended outcome:
I'm trying to generate flow types for a mutation. I have the following mutation:
When I define a graphql mutation client-side like this:
I expect that types for
PlaceOrderMutationInput
will only be generated in thePlaceOrder.js
file.Actual outcome:
Every single other file generated by apollo codegen in my project also contains the
PlaceOrderMutationInput
type. This seems incorrect, and is annoying as it adds a huge amount of noise to git diffs etc.How to reproduce the issue:
The command I'm running is:
Versions
apollo@2.4.4
Thanks very much!
The text was updated successfully, but these errors were encountered: