OperationTypeDefinition class

A Root Operation.

A schema defines the initial root operation type for each kind of operation it supports query, mutation, and subscription; this determines the place in the type system where those operations begin.

The query root operation type must be provided and must be an ObjectTypeDefinition.

The mutation root operation type is optional; if it is not provided, the service does not support mutations. If it is provided, it must be an ObjectTypeDefinition.

Similarly, the subscription root operation type is also optional; if it is not provided, the service does not support subscriptions. If it is provided, it must be an ObjectTypeDefinition.

The fields on the query root operation type indicate what fields are available at the top level of a GraphQL query.

Default Root Operation Type Names

While any type can be the root operation type for a GraphQL operation, the type system definition language can omit the schema definition when the query, mutation, and subscription root types are named Query, Mutation, and Subscription respectively.

Likewise, when representing a GraphQL schema using the type system definition language, a schema definition should be omitted if it only uses the default root operation type names.

Inheritance
Annotations
  • @immutable

Properties

astNode OperationTypeDefinitionNode
final
hashCode int
The hash code for this object.
no setterinherited
operation OperationType
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type NamedType
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object o) bool
The equality operator.
inherited