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: GraphQLEnum value camelCase conversion strategy #2745

Merged
merged 6 commits into from
Jan 5, 2023

Conversation

calvincestari
Copy link
Member

@calvincestari calvincestari commented Dec 23, 2022

This PR refactors the .camelCase conversation strategy implementation

@netlify
Copy link

netlify bot commented Dec 23, 2022

Deploy Preview for apollo-ios-docs canceled.

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

@calvincestari
Copy link
Member Author

I'm putting this back into draft to fix #2749.

@calvincestari calvincestari marked this pull request as draft January 3, 2023 17:43
@calvincestari calvincestari marked this pull request as ready for review January 3, 2023 22:10
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.

Thanks so much for nailing this @calvincestari! Let's just make sure the license is okay and then move this forward!

}
return value

return value.components(separatedBy: "_")
Copy link
Member Author

Choose a reason for hiding this comment

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

It might look odd to be separating by _ and then converting empty elements back to _ but that's the trick to preserving leading/trailing _ without having to find the first/last indexes around them.

Copy link
Member Author

@calvincestari calvincestari Jan 5, 2023

Choose a reason for hiding this comment

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

components(separatedBy:) also preserves empty _ positions vs. split which would just give us the inner 'words'.

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.

Awesome job on this!

@AnthonyMDev AnthonyMDev merged commit 73f4f0d into main Jan 5, 2023
@AnthonyMDev AnthonyMDev deleted the fix/enum-case-conversion-strategy branch January 5, 2023 18:52
@calvincestari calvincestari mentioned this pull request Jan 10, 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
2 participants