Skip to content
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

fix: fields labeled _ #2769

Merged
merged 4 commits into from
Jan 12, 2023
Merged

fix: fields labeled _ #2769

merged 4 commits into from
Jan 12, 2023

Conversation

calvincestari
Copy link
Member

@calvincestari calvincestari commented Jan 11, 2023

Fixes #2753

This PR brings back the _ character as an allowed field name. Removing it from DisallowedFieldNames and adding it to FieldAccessorNamesToEscape causes it to be escaped as expected in all property and initializer definitions.

This functionality is dependent on #2759 being fixed too.

@netlify
Copy link

netlify bot commented Jan 11, 2023

Deploy Preview for apollo-ios-docs canceled.

Name Link
🔨 Latest commit d03579b
🔍 Latest deploy log https://app.netlify.com/sites/apollo-ios-docs/deploys/63be432a9b8c9f0009fef7f1

@calvincestari
Copy link
Member Author

@AnthonyMDev the input objects and mocks work as expected but the initializer provided by autocomplete lacks backticks around the _; I'm not aware of any way to 'fix' that for autocompletion.

Let's talk about it tomorrow. I'm not sure how I feel about it since it's not a great user experience but I feel it's better than simply disallowing _ as a field name.

Copy link
Contributor

@AnthonyMDev AnthonyMDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@calvincestari calvincestari merged commit d9eb2cb into main Jan 12, 2023
@calvincestari calvincestari deleted the fix/unnamed-fields branch January 12, 2023 21:00
@calvincestari calvincestari mentioned this pull request Feb 8, 2023
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unnamed fields in schema results in broken generated Swift code
2 participants