GraphQLType<Value, Serialized> class abstract

Strictly dictates the structure of some input data in a GraphQL query.

GraphQL's rigid type system is primarily implemented in Dart using classes that extend from GraphQLType.

A GraphQLType represents values of type Value as values of type Serialized; for example, a GraphQLType that serializes objects into Strings.

Implementers
Available Extensions

Constructors

GraphQLType()
Strictly dictates the structure of some input data in a GraphQL query.
const

Properties

description String?
A description of this type, which, while optional, can be very useful in tools like GraphiQL.
no setter
generic GenericHelp<Value>
Utility for working with the Value Generic type
no setter
hashCode int
The hash code for this object.
no setterinherited
isNonNullable bool
true when the type can not be null
no setter
isNullable bool
true when the type can be null
no setter
name String?
The name of this type.
no setter
printableName String
The name of this type with defaults for GraphQLWrapperType. Can be used as a name of another GraphQL type, useful for composing names for generic types, for example.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

coerceToInputObject() GraphQLType<Value, Serialized>
Turns this type into one suitable for being provided as an input to a GraphQLObjectField.
deserialize(SerdeCtx serdeCtx, Serialized serialized) → Value
Deserializes a serialized value.
list() GraphQLListType<Value?, Serialized>
Returns a GraphQLListType with the inner type set to this
nonNull() GraphQLNonNullType<Value, Serialized>
Creates a non-nullable type that represents this type, and enforces that a field of this type is present in input data.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
nullable() GraphQLType<Value, Serialized>
Returns a nullable type that represents this type. If the type is isNullable returns itself without changes.
serialize(Value value) → Serialized
Serializes a value.
serializeSafe(Object? value, {bool nested = true}) → Serialized
toString() String
A string representation of this object.
override
validate(String key, Object? input) ValidationResult<Serialized>
Performs type coercion against an input value, and returns a list of errors if the validation was unsuccessful.
when<O>({required O enum_(GraphQLEnumType<Value>), required O scalar(GraphQLScalarType<Value, Serialized>), required O object(GraphQLObjectType<Value>), required O input(GraphQLInputObjectType<Value>), required O union(GraphQLUnionType<Value>), required O list(GraphQLListType), required O nonNullable(GraphQLNonNullType<Value, Serialized>)}) → O
Executes any of the provided function with this as argument. The function executed depends on the type of this
whenMaybe<O>({O enum_(GraphQLEnumType<Value>)?, O scalar(GraphQLScalarType<Value, Serialized>)?, O object(GraphQLObjectType<Value>)?, O input(GraphQLInputObjectType<Value>)?, O union(GraphQLUnionType<Value>)?, O list(GraphQLListType)?, O nonNullable(GraphQLNonNullType<Value, Serialized>)?, required O orElse(GraphQLType)}) → O
Similar to when, but with optional arguments and a required default case orElse, which is executed when none of the provided functions match this
whenOrNull<O>({O? enum_(GraphQLEnumType<Value>)?, O? scalar(GraphQLScalarType<Value, Serialized>)?, O? object(GraphQLObjectType<Value>)?, O? input(GraphQLInputObjectType<Value>)?, O? union(GraphQLUnionType<Value>)?, O? list(GraphQLListType)?, O? nonNullable(GraphQLNonNullType<Value, Serialized>)?}) → O?
Similar to when, but with optional arguments. Returns null when none of the provided functions match this

Operators

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