fields_have_appropriate_selections
does not require selections on union types
#4351
Milestone
fields_have_appropriate_selections
does not require selections on union types
#4351
Describe the bug
The
fields_have_appropriate_selections
validation presently allows the following selection:With
myUnion
being a union type, this query returns the following payload:The spec would require a union type to make a selection.
Cause
The issue occurs here: https://github.com/rmosolgo/graphql-ruby/blob/master/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb#L34
The cause of the issue is that the
fields?
check omits union types. To fix this validation, the check should usecomposite?
instead offields?
.Steps to resolution
Unfortunately this is a breaking change as sources that used to validate will now fail. Need to:
FieldsWillMerge
validation #4403The text was updated successfully, but these errors were encountered: