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

Constructors

OperationTypeDefinition(OperationTypeDefinitionNode astNode)
const

Properties

astNode OperationTypeDefinitionNode
final
hashCode int
The hash code for this object. [...]
read-only, inherited
operation OperationType
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
type NamedType
read-only

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

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