Not Null Types
It is used to define that a particular field is required i.e. it cannot be null. There must be some value that the field should have. It can be represented by exclamation mark (!). Add this exclamation mark (!), at the end of the type to make it Not Null.
Syntax:
field_name: data_type!
Example:
type Student {
name: String!
age: Int!
}
Types in GraphQL
GraphQL is a strongly typed query language used as a manipulative language for various APIs. It is also called a query language for APIs. GraphQL also helps to describe our data. GraphQL services can run in any language In this, Types are the fundamental concepts that define various data types present in GraphQL and It is also used to define the schema using different data types. There are multiple types in GraphQL.
Contact Us