graphql-spec
graphql-spec copied to clipboard
Clarify validation rule on non-null type wrapping another non-null type
The specification states that:
A Non-Null type must not wrap another Non-Null type.
In the specification we see the type [Int!]!
used in an example, which is a non-null list type that wraps another non-null named type.
The validation rule cannot hold and the example be valid simultaneously.
The example is a non-null type wrapping a list type that wraps a non-null type (allowed) rather than a non-null type directly wrapping a non-null type.
The example is a non-null type wrapping a list type that wraps a non-null type (allowed) rather than a non-null type directly wrapping a non-null type.
How would one hypothetically define a non-null type that directly wraps another non-null type, while also being grammatically correct?
The only counter-example I can currently think of is Int!!
, but the grammar doesn't allow such a production.
I don't think there is such an example -- such that the SDL constraint in this regard matches the type system constraint.