-
Notifications
You must be signed in to change notification settings - Fork 737
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
Reserved keyword "self" is not escaped in 1.0 Beta 1 codegen #2424
Comments
Ooooh, we did not think about this! We're going to need to create a list of all reserved keywords and backtick on all of them! Thanks for the report, we will get this in a beta release coming up soon! |
I've been working on this issue, and there are a lot of extra edge cases here that are going to take me longer to work through. I've got a branch I'm working on right now where fields with names of reserved keywords should work now when the field is a scalar field. I need to handle the escaping properly for the names of the generated My goal is to have a Beta out by the end of the week, which will include backtick escaping names of fields as described in this issue originally. But there is a ton of other work that will probably have to come in the next Beta. I also have to get this working when keywords are used as the names of:
It's going to take longer to get this working... lots of complications. One being that when you have a type in your schema with a reserved keyword name like Thanks for making me aware of this issue. Hope this update helps with your planning! |
Okay, the PR (#2432) is merged into This part will make it into the beta which I aim to release tomorrow (8/11/2022). @scottasoutherland Please try depending on the release branch and verify that this works for you as needed now! |
I'm going to leave this issue open to track the rest of the needed changes as well. |
Most of this work is done and now available in beta 2. We'll create new tracking issues for the remaining items. |
👋🏻 @AnthonyMDev / @hwillson are there known new/remaining issues here?
Generated:
As you can see, the Happy to put this in a separate issue if this is new, but just ran into it! 👏🏻 Thanks for all you do! |
Hi @pluddy, this was fixed with #2773 which hasn't been published in a release yet. It will go out with |
Awesome @calvincestari, looking forward to it! Thanks for the quick response 👊🏻 |
Bug report
We have an existing project which has query called "self" i.e. the query looks like
and likewise the query in the schema is named
self
. When running codegen in0.51.2
the usages of Self or self are escaped properly using back-ticks. However in 1.0 Beta 1 the code generation does not escape self and we get compiler errors such asor
Getter/setter can only be defined for a single variable
when it interpretsself
as the keyword.Versions
Please fill in the versions you're currently using:
apollo-ios
SDK version: 1.0 Beta 1Steps to reproduce
Further details
The text was updated successfully, but these errors were encountered: