-
Notifications
You must be signed in to change notification settings - Fork 734
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
Codegen Option: Optional Exported Imports #3322
Comments
Thanks for the feedback @Mordil. Without the Though we do agree that Because Additionally, we are currently working on this issues which will allow you to rename the generated names of schema types, including custom scalars. This will help you get around the naming conflicts with things like |
That doesn't necessarily help us with conflicts between I understand the rationale for the default as it is, because it does simplify using things as you described by not requiring |
Yeah, that definitely doesn't feel great either right now. FWIW, there is some pretty extensive discussion of this topic in this issue already. But I don't think I think the parts of |
Basically we would have:
Then the generated models end up having their import statements look like: @_exported @spi(exports) import ApolloAPI
@spi(internal) import ApolloAPI Though I'm concerned that the compiler won't let that work, due to seeing it as duplicate import statements for |
@AnthonyMDev Wouldn't we want to have everything that would be useful to consumers still just be regular |
There are a lot of parts of By exporting all of There are also pieces that are not intended for public consumption, but are consumed by the generated models. These pieces should be part of the The only pieces that need to be exported are the pieces that you need to use to interact with the generated models, like |
Yea I was just recommending that maybe for things like |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better. |
Use case
Generated operations files are always
@_exported import Apollo API
and it's causing conflicts throughout our codebase withObject
and Realm's definition ofObject
, and our GraphQL ScalarDate
withFoundation.Date
In general, it's a mixed bag of using
@_exported import
statements due to the nature ofDescribe the solution you'd like
The codegen output should be updated much like the operations were for marking them as
final
https://github.com/apollographql/apollo-ios/pull/3189/filesThe text was updated successfully, but these errors were encountered: