Fix introspection of default input objects#3456
Conversation
It seems that the intent was to allow default input object values to be specified in snake_case, but we weren't camelCasing them on output which was leading to issues. Tweak an existing spec to cover this case (as well as the "enums specifed as values not names" case), then add the missing call to camelize.
|
You got the intention right -- I meant for the |
|
I'm trying to think, some people might've worked around this issue, will it "break" them if we fix it here? (I think that's ok, but I want to get it right in the changelog.) |
|
🤔 I don't think it will break anything unless the user has disabled auto-camelization of argument names in general and is creating snake_case arguments in their actual schema? Otherwise writtenAsCamel default values should continue to pass through, and written_as_snake arguments will start working where they didn't before. |
|
Thanks for helping me think through that -- anyone who worked around this before should still be good to go 👍 |
It seems that the intent was to allow default input object values to be
specified in snake_case, but we weren't camelCasing them on output which
was leading to issues (in introspection and also schema printing).
See e.g.
string_valuewhich is actually the default for an argumentstringValue(because graphql-ruby automatically camelCases argument names at definition time), ingraphql-ruby/spec/support/jazz.rb
Line 543 in 173ad1b
Tweak an existing spec to cover this case (as well as the "enums
specifed as values not names" case), then add the missing call to
camelize.
@rmosolgo I'm not actually 100% sure if I'm interpreting the intention here properly. The code is obviously trivial/straightforward but maybe the intention was to force people to write their default values in camelCase and it's the Jazz schema that made a mistake?
This is a second stand-alone extraction from #3448.
cc @benjie