TypeDefinition class abstract
The fundamental unit of any GraphQL Schema (spec).
There are six kinds of named type definitions in GraphQL, and two wrapping types.
The most basic type is a Scalar
(ScalarTypeDefinition).
A scalar represents a primitive value, like a string or an integer.
Oftentimes, the possible responses for a scalar field are enumerable.
GraphQL offers an Enum
(EnumTypeDefinition) type in those cases,
where the type specifies the space of valid responses.
Scalars
and Enums
form the leaves in response trees;
the intermediate levels are Object
types (ObjectTypeDefinition),
which define a set of fields,where each field is another type in the system,
allowing the definition of arbitrary type hierarchies.
GraphQL supports two abstract types (AbstractType): interfaces and unions.
An Interface
(InterfaceTypeDefinition) defines a list of fields;
Object types that implement that interface are guaranteed to implement those fields.
Whenever the type system claims it will return an interface, it will return a valid implementing type.
A Union
(UnionTypeDefinition) defines a list of possible types;
similar to interfaces, whenever the type system claims a union will be returned,
one of the possible types will be returned.
Finally, oftentimes it is useful to provide complex structs as inputs to GraphQL field arguments or variables;
the Input Object
type (InputObjectTypeDefinition) allows the schema to define exactly what data is expected.
- Inheritance
-
- Object
- GraphQLEntity
- TypeSystemDefinition
- TypeDefinition
- Implementers
- Annotations
-
- @immutable
Constructors
- TypeDefinition()
-
const
Properties
- astNode → TypeDefinitionNode
-
The underlying definition node from
gql/ast.dart
no setteroverride - description → String?
-
no setter
-
directives
→ List<
Directive> -
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String?
-
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
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
Static Methods
-
fromNode(
TypeDefinitionNode node) → TypeDefinition