-
Notifications
You must be signed in to change notification settings - Fork 428
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
Allow disabling case convertion #765
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, this looks great! A couple of changes / suggestions:
- We'll need a couple of unit tests or integration tests to make sure this isn't broken in the future.
- I'd prefer to match the API from http://serde.rs. That is,
rename
in a field is for a specific name set verbatim and the ability to use a rename strategy at the top-level is on the object definition.
I'm not sure I totally get the second point. There are differences between juniper and serde:
Each struct member already can be renamed explicitly with the |
I will add some tests for sure :) |
Ugh, sorry...read that way too fast and was fried from work. You're right, ignore #2 :-) |
Added some tests. |
Thank you! I'll land this in a couple of days. |
Hey! Any updates on this? |
Add a new attribute
rename
which could be "none", "camelCase", "SCREAMING_SNAKE_CASE".By default (when this attribute is not specified) the exiting rules apply: camelCase to structs, SCREAMING_SNAKE_CASE to enums.
Inspired by Serde & Structopts.
This does not change interfaces because I haven't figured how to do them yet.
Re #201.