Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Clarify validation rule on non-null type wrapping another non-null type #992

Open
polarina opened this issue Oct 11, 2022 · 3 comments
Open

Comments

@polarina
Copy link

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.

@yaacovCR
Copy link
Contributor

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.

@polarina
Copy link
Author

polarina commented Oct 12, 2022

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.

@yaacovCR
Copy link
Contributor

I don't think there is such an example -- such that the SDL constraint in this regard matches the type system constraint.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants