-
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
InputObjects generated with incorrect getter/setter key #2858
Comments
Found the same issue, on both versions. This also causes the apps to crash if you attempt to use the getter as Apollo will force cast Issue seems to be located here: apollo-ios/Sources/ApolloCodegenLib/Templates/RenderingHelpers/String+SwiftNameEscaping.swift Line 21 in d9eb2cb
|
Thanks for reporting this @Austinpayne, we'll get it resolved in the next release. |
Thank you @calvincestari! I appreciate your responsiveness, always very impressive! |
Hello @calvincestari @BobaFetters, I'm experiencing this issue too. I just wanted to show my input object in case it might be helpful for the solution. However, I forked the fix/generated-getter-setter-case branch and run the ./apollo-ios-cli generate command to check if it's solved or not but still getting the same generated code as below. When I manually change set { __data["aND"] = newValue } to set { __data["AND"] = newValue } query works.
|
@alkincakiralar1996 can you provide a sample schema and operation definitions that I could use to test your case and see if further changes are required to resolve the issue? |
Hi @BobaFetters, thanks for the quick reply. I'll put the piece of code from the schema that can be related to "QueryListingsWithPaginationWhereWhereConditions" below. We have a query that returns some kind of model data that can be filterable. We are using this "QueryListingsWithPaginationWhereWhereConditions" type inside of that query as a where parameter. Do you want me to signify another thing that helps you to test this case?
|
@alkincakiralar1996 when you forked the fix/generated-getter-setter-case branch, did you also build an |
I was just researching this, yes you're right I still use the old apollo-ios-cli. How can I build a new apollo-ios-cli executable ? |
Yes, now it works. Sorry for the misunderstanding, thanks for your patience and your effort. |
The makefile in the root of the repo has a command to build it - |
Summary
I'm having a issue with a custom input that results in different string keys being generated for
InputObjects
in theinit
and the associated getter/setter. For example:Note that the
__data
in theinit
uses the string key "ID" while thevar iD
getter/setter usesiD
.Version
1.0.7 (I also saw it on 1.0.5)
Steps to reproduce the behavior
The above issue was seen using the following operation definitions:
Where
EquipmentFilterInput
is defined as the following in the schema:Logs
The above bug results in the query being malformed and returning errors like
If I manually change
__data["iD"]
to__data["ID"]
then queries are successful.Anything else?
No response
The text was updated successfully, but these errors were encountered: