You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.
Hi! I seem to be hitting an issue where I have a union type, and two of the types in that union share a common field, with different nullability. For example:
type Size {
height: Int!
weight: Int!
}
type Cat {
name: String!
size: Size! # `size` is REQUIRED on `Cat`
}
type Mouse {
name: String!
size: Size # `size` is OPTIONAL on `Mouse`
}
When I query for this, the error I get is:
java.lang.IllegalStateException: Validation error of type FieldsConflict: size: fields have different nullability shapes @ 'animals'
Is there something I should be configuring to get around this? Or is this a bug?
Haven't checked the GraphQL specification, but if according the specification this should be allowed you could raise an issue in the graphql-java project.
Thanks @oliemansm. Did a bit more digging to see if this is allowed in the schema and found this very similar issue: graphql/graphql-js#1361. There's some discussion there, and a workaround in the first response.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi! I seem to be hitting an issue where I have a union type, and two of the types in that union share a common field, with different nullability. For example:
When I query for this, the error I get is:
Is there something I should be configuring to get around this? Or is this a bug?
There is a repo where this can be reproduced here: https://github.com/yonigibbs/graphql-union-type
Thanks!
The text was updated successfully, but these errors were encountered: