Fix introspection of default input objects #3456
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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_value
which 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