GraphQL nullability mismatch for many arrays
Many GraphQL arrays that can never be null
are not marked as mandatory in the GraphQL schema. This makes it unnecessary complicated to consume the API.
For example when querying regions {}
we get:
regions: [Region]
This is a nullable array of a nullable Region, so both the array, and its items can be NULL. Should probably be [Region!]!
instead?
Then when querying a regions events with regions { events() {} }
we get:
events(...): [[Event]]
Two nullable arrays, with a nullable item inside. Instead it should probably be [[Event!]!]!
?
Here's an incomplete list of cases I noticed:
-
regions {}
: [Region] -
regions { events(){} }
: Event -
Event.links
: [EventLink]! -
Event.genres
: [Genre]! -
Event.tags
: [String]! -
Event.variants
: [EventVariant]! - ...
Probably most non-scalar values should be mandatory.
@andreas1 wdyt?
Edited by Reto Kaiser