-
Notifications
You must be signed in to change notification settings - Fork 738
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
feature: final class definitions for graphql codegen #3189
Conversation
👷 Deploy request for apollo-ios-docs pending review.Visit the deploys page to approve it
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for working on this! Implementation looks spot on to me! Just a couple things to consider.
-
We need to add the new option to the documentation of the CLI
-
I think we should also add the
final
keyword to local cache mutations if this option istrue
. That would be done in theLocalCacheMutationDefinitionTemplate
. -
@BobaFetters what do you think of the naming of this configuration option? I'm not coming up with a better name off the top of my head right now, but I feel like it's not clear what
finalOperationDefinitions
means without having to read the docs.
I just came up with It'd probably be easier to make it so that it applies to all classes to start with, and if people say they want more granular control, later the options are split into further sub-options |
Overall I think this looks great, thanks for taking this on! As for naming, since the |
I don't have a strong preference. It's what y'all think is best. |
@AnthonyMDev thoughts? |
I'm less inclined to want
Yes I agree. I'm happy with the config option named |
I felt like What about And I agree with @calvincestari that mocks should not be |
Again, I have zero preferences. I'll update the PR with this new proposed name, at the same time that I'll squash the commits and update with the latest version of the dev branch. Appreciate the feedback! |
99aa434
to
01010ac
Compare
Thanks so much for this @Mordil! This looks great! Merging this in now, we'll get it out in the next release! |
Re-adds generated GraphQL operations to be marked as
final
through a newOutputOptions
property:markClassesAsFinal
.This is to support fixing this in a backwards-compatible way, and still allowing people control over how they use the generated operation models.
This resolves #3183