-
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
Invalid Redeclaration of a Model #2438
Comments
Hi @hamedaakhlaghi, thanks for the bug report. Can you tell me which version of apollo-ios you're using? |
@calvincestari your welcome, I tested "0.51.0", "0.52.0", "0.53.0" |
OK, I just wanted to clarify whether this was feedback for the upcoming 1.0 release, currently in beta. Is |
Is this a new problem with these three versions, did the code generation work for you on an older version? |
@calvincestari this model is one of our new models, Let me test it with the older versions, I'm in the middle of testing it with the beta version. could you please send me the exact version that you think there is not this problem? |
We don't have any bug reports of this kind of problem with the current 0.53.0 version. I'm surprised why two fields of the same type would duplicate the
1.0 is a breaking change, there are many changes and improvements to the API. |
I hope to find the correct version for resolving this issue |
Can you share some of the generated code - the structs where the duplication is happening? |
sure, I will be sent it in 30 min |
This is definitely odd behavior. I'm almost certain this won't exist in the 1.0 version, as we've re-written the entire code generation engine. While it is a breaking change, we hope the migration to 1.0 isn't terribly difficult or painful. In most cases, it shouldn't cause you to have to make massive re-writes, just setting up the new codegen and changing some call sites perhaps. As for the old codegen, it might be more helpful if we could take a look at your schema as well. I understand that is probably sensitive data, so if you can't share it with us I understand. Or if you could share it with us privately rather than via a public link, I'd love to take a look at that. I'll be honest, the reason we re-wrote the codegen engine for 1.0 is that the old codegen engine was buggy and very difficult to make changes to. If there is something wrong in your schema or operations that we can deduce to help resolve this great, but its unlikely that we are going to be able to allocate the resources to digging into the legacy code generation engine and fixing bugs there. The 1.0 is very close to being stable now, and I highly recommend you being the process of migrating to this version when you are able to. Specifically because we don't intend to maintain the legacy codegen engine any longer. The 1.0 Beta 2 is going to be released soon (hopefully today!) and we expect that to be very very close to ready for a General Release. |
@AnthonyMDev thank you for your effort, I'll send you the data that I have permission to share with you as soon as possible (to your email), is it OK?
|
Closing this issue due to inactivity - if this is still an issue please comment here and we can revisit. |
I'm experiencing an issue similar to this using In my case the schema contains something like:
which is causing the |
@troyST I think what you're experiencing is described in #2850. The fix is for you to use a field alias and disambiguate the type names. see #2850 (comment). We're going to make the codegen engine detect this and provide a warning on how to fix but it won't automatically resolve the conflicting singular/plural name generation, you will still need to do that through a field alias. |
@calvincestari I will take a look at the linked issue. Thank you for the quick response! |
our server has a model with two fields:
when I downloaded the schema there were two struct for
Discount
and I got this error :/Users/hamed/Documents/workspaces/ice/Modules/Core/Network/Sources/Network/Schemas/Operations/cart.graphql.swift:5682:25: Invalid redeclaration of 'Discount'
when I remove one of them from my
.graphql
file everything is OKI asked our other developers (android and front) they don't have this issue
could you please answer me?
The text was updated successfully, but these errors were encountered: