Non-null Constraints

Learn how to make arguments non-null.

We'll cover the following...

Marking arguments as non-null

Exclamation marks are used in variable declarations to ensure that variable values are provided:

Press + to interact
query ($filter: MenuItemFilter!) {
menuItems(filter: $filter) {
name
}
}

The document here declares that the $filter variable is a MenuItemFilter. Adding an exclamation mark denotes a mandatory value. This is a constraint that the document designer builds into the query, but the schema ...