GraphQLObjectType<P> class

A GraphQLType that specifies the shape of structured data, with multiple fields that can be resolved independently of one another.

Inheritance
Available Extensions

Constructors

GraphQLObjectType(String name, {String? description, bool isInterface = false, ResolveType<GraphQLObjectType<P>>? resolveType, IsTypeOf<P>? isTypeOf, Iterable<GraphQLObjectField<Object?, Object?, P>> fields = const [], Iterable<GraphQLObjectType> interfaces = const [], GraphQLTypeDefinitionExtra<TypeDefinitionNode, TypeExtensionNode> extra = const GraphQLTypeDefinitionExtra.attach([])})
A GraphQLType that specifies the shape of structured data, with multiple fields that can be resolved independently of one another.

Properties

astNode → TypeDefinitionNode?
If this was parsed from an ast, the node in that ast
no setterinherited
attachments GraphQLAttachments
Other custom values that may modify the execution, validation or introspection for this element
no setterinherited
description String?
An optional description of this type; useful for tools like GraphiQL.
final
extra GraphQLTypeDefinitionExtra<TypeDefinitionNode, TypeExtensionNode>
TODO: 2A interface
final
fields List<GraphQLObjectField<Object?, Object?, P>>
The list of fields that an object of this type is expected to have.
final
generic GenericHelp<P>
Utility for working with the Value Generic type
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
interfaces List<GraphQLObjectType>
A list of other types that this object type is known to implement.
no setter
isInterface bool
true if this type should be treated as an interface, which child types can inheritFrom.
final
isNonNullable bool
true when the type can not be null
no setterinherited
isNullable bool
true when the type can be null
no setterinherited
isTypeOf IsTypeOfWrapper<P>?
When provided, this function should return true for values which are associated with this object type
final
name String
The name of this type.
final
possibleTypes List<GraphQLObjectType>
A list of other types that implement this interface.
no setteroverride
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 setterinherited
resolveType ResolveTypeWrapper<GraphQLObjectType<P>>?
When this is an interface (isInterface == true), this function returns the name of the GraphQLObjectType in possibleTypes which implements the resolved result passed in the parameter
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

coerceToInputObject() GraphQLType<P, Map<String, dynamic>>
Turns this type into one suitable for being provided as an input to a GraphQLObjectField.
override
deserialize(SerdeCtx serdeCtx, Map<String, Object?> serialized) → P
Deserializes a serialized value.
inherited
fieldByName(String name) GraphQLObjectField<Object?, Object?, P>?
Returns the field with the given name
inherited
inheritFrom(GraphQLObjectType other, {bool inheritInterfaces = true}) → void
Declares that this type inherits from another parent type.
inheritFromMany(Iterable<GraphQLObjectType> others, {Set<GraphQLObjectType>? alreadyInherited}) → void
Declares that this type inherits from other parent types.
isImplementationOf(GraphQLObjectType type) bool
Returns true if this type, or any of its parents, is a direct descendant of another given type.
list() GraphQLListType<P?, Map<String, dynamic>>
Returns a GraphQLListType with the inner type set to this
inherited
nonNull() GraphQLNonNullType<P, Map<String, dynamic>>
Creates a non-nullable type that represents this type, and enforces that a field of this type is present in input data.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
nullable() GraphQLType<P, Map<String, dynamic>>
Returns a nullable type that represents this type. If the type is isNullable returns itself without changes.
inherited
serialize(P value) Map<String, dynamic>
Serializes a value.
inherited
serializeSafe(Object? value, {bool nested = true}) Map<String, dynamic>
inherited
toInputObject(String name, {String? description, P customDeserialize(Map<String, Object?>)?}) GraphQLInputObjectType<P>
Converts this into a GraphQLInputObjectType.
toString() String
A string representation of this object.
inherited
validate(String key, Object? input) ValidationResult<Map<String, dynamic>>
Performs type coercion against an input value, and returns a list of errors if the validation was unsuccessful.
override
when<O>({required O enum_(GraphQLEnumType<P>), required O scalar(GraphQLScalarType<P, Map<String, dynamic>>), required O object(GraphQLObjectType<P>), required O input(GraphQLInputObjectType<P>), required O union(GraphQLUnionType<P>), required O list(GraphQLListType), required O nonNullable(GraphQLNonNullType<P, Map<String, dynamic>>)}) → O
Executes any of the provided function with this as argument. The function executed depends on the type of this
inherited
whenMaybe<O>({O enum_(GraphQLEnumType<P>)?, O scalar(GraphQLScalarType<P, Map<String, dynamic>>)?, O object(GraphQLObjectType<P>)?, O input(GraphQLInputObjectType<P>)?, O union(GraphQLUnionType<P>)?, O list(GraphQLListType)?, O nonNullable(GraphQLNonNullType<P, Map<String, dynamic>>)?, 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
inherited
whenOrNull<O>({O? enum_(GraphQLEnumType<P>)?, O? scalar(GraphQLScalarType<P, Map<String, dynamic>>)?, O? object(GraphQLObjectType<P>)?, O? input(GraphQLInputObjectType<P>)?, O? union(GraphQLUnionType<P>)?, O? list(GraphQLListType)?, O? nonNullable(GraphQLNonNullType<P, Map<String, dynamic>>)?}) → O?
Similar to when, but with optional arguments. Returns null when none of the provided functions match this
inherited

Operators

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