-
Notifications
You must be signed in to change notification settings - Fork 731
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: Append type to generated filenames #3354
Comments
I believe this is a known issue @michaelloo, and unfortunately we don't have a workaround that isn't manual at the moment. Xcode really should just be able to handle this to be honest. A solution that works with codegen may have to be adding a name suffix to each file with what kind it is; |
😢 Ah ok... we'll have a script them to rename the file for now after updating the models, thanks for the response! |
Hi @calvincestari , on a somewhat related note, what is the suggested approach if we have the same codebase relying on multiple APIs with different GraphQL schemas? Meaning having multiple
|
Apollo iOS is not designed to work with multiple schemas at once and to do so requires a bit of careful configuration. To resolve the duplicate |
I see, we'll get onto that but this isn't an ideal solution so i've opened a separate feature request here 🙏 |
A workaround for this is being implemented currently. See #3283 for more info. Once that is released, you'll be able to change the generated names of these types (including file names) to |
The workaround for this in #3283 has been shipped in |
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. |
Summary
If you have an
INPUT_OBJECT
type with nameAddress
, and aOBJECT
type with the same nameAddress
, you end up with a conflictingfilename
which causes an Xcode compile issue:The struct name are ok because they are nested under different levels:
Version
1.9.0
Steps to reproduce the behavior
apollo-codegen-config:
I am unable to give you a full view of the schema unfortunately but here are some snippets of it:
If I rename one of the conflicting files, then I am able to get through this error, (e.g.:
AddressInput
).Logs
No response
Anything else?
Is there a way to specify the output to be in a single file (like it used to be able to do)? Then I can avoid this filename conflict
The text was updated successfully, but these errors were encountered: