-
Notifications
You must be signed in to change notification settings - Fork 730
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
Add option to generate objects with internal access modifier #2630
Comments
Hi @simonbilskyrollins 👋🏻 - thanks for the feature request. Are you proposing changing the access modifier for just operation models, all generated code or a more intelligent where-possible approach? I can see a case being made for all operation model code to be |
Hello @calvincestari! Personally, I would like to be able to make both operation models and schema types I do see some opportunities to make this functionality more intelligent than a simple |
I'm a strong advocate for less configuration options, IMO there are too many already. 😬 I think we might be able to get away with a single enum option, as was available in 0.x, and the codegen engine does what it can to match, i.e.: in the case standalone schema modules it simply remains |
Fair enough! If we can make this work with a single configuration option that's definitely the way we should go. |
I'm interested in this feature as well, but I'd like to be able to control access to fragment types a bit more fine-grained. For most operations I'd prefer |
There are many places we'd love to support custom directives, and this one sounds like another good option for consideration. A workaround that you could leverage at the moment is that if you are using |
@simonbilskyrollins, this was released in 1.2 earlier this week. Please give it a try and let me know if it satisfies what you wanted. Thanks. |
Feature request
Add option to generate objects with internal access modifier.
Motivation
All of the objects generated by Apollo codegen currently have the
public
access modifier. This setup is great if you need to use generated objects across module boundaries, but if you do not then all of that public code can negatively affect both compile times and app size. Adding a codegen option to make these objectsinternal
instead ofpublic
would fix these problems.I believe this request is the same as #149 which was closed and completed, but the functionality does not yet exist in 1.x.
The text was updated successfully, but these errors were encountered: