GraphQLInputObjectType<Value> class
A special GraphQLType that specifies the shape of an object that can only be used as an input to a GraphQLField.
GraphQL input object types are different from regular GraphQLObjectTypes in that they do not support resolution, and are overall more limiter in utility, because their only purpose is to reduce the number of parameters to a given field, and to potentially reuse an input structure across multiple fields in the hierarchy.
- Inheritance
-
- Object
- GraphQLType<
Value, Map< String, dynamic> > - GraphQLNamedType<
Value, Map< String, dynamic> > - GraphQLInputObjectType
- Available Extensions
Constructors
-
GraphQLInputObjectType(String name, {String? description, Iterable<
GraphQLFieldInput< fields = const [], Value customDeserialize(Map<Object?, Object?> >String, Object?> )?, GraphQLTypeDefinitionExtra<InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode> extra = const GraphQLTypeDefinitionExtra.attach([]), bool isOneOf = false}) - A special GraphQLType that specifies the shape of an object that can only be used as an input to a GraphQLField.
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
-
customDeserialize
→ (Value Function(Map<
String, Object?> )?) -
A function which parses a JSON Map into the
Value
typefinal - description → String?
-
An optional type of this type, which is useful for tools like GraphiQL.
final
-
extra
→ GraphQLTypeDefinitionExtra<
InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode> -
final
-
fields
→ List<
GraphQLFieldInput> -
A list of the fields that an input object of this
type is expected to have.
final
-
generic
→ GenericHelp<
Value> -
Utility for working with the
Value
Generic typeno setterinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- isNonNullable → bool
-
true when the type can not be null
no setterinherited
- isNullable → bool
-
true when the type can be null
no setterinherited
- isOneOf → bool
-
If this is true, only one of the fields should be non null when parsing
final
- name → String
-
The name of this type.
final
- 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
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addDefaults(
Map< String, Object?> values) → Map<String, Object?> -
coerceToInputObject(
) → GraphQLType< Value, 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) → Value -
Deserializes a serialized value.
override
-
fieldByName(
String name) → GraphQLFieldInput? -
Returns the field with the given
name
inherited -
list(
) → GraphQLListType< Value?, Map< String, dynamic> > -
Returns a GraphQLListType with the inner type set to this
inherited
-
nonNull(
) → GraphQLNonNullType< Value, 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< Value, Map< String, dynamic> > -
Returns a nullable type that represents this type.
If the type is isNullable returns itself without changes.
inherited
-
serialize(
Value value) → Map< String, dynamic> -
Serializes a
value
.inherited -
serializeSafe(
Object? value, {bool nested = true}) → Map< String, dynamic> -
inherited
-
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< Value> ), required O scalar(GraphQLScalarType<Value, Map< ), required O object(GraphQLObjectType<String, dynamic> >Value> ), required O input(GraphQLInputObjectType<Value> ), required O union(GraphQLUnionType<Value> ), required O list(GraphQLListType), required O nonNullable(GraphQLNonNullType<Value, Map< )}) → OString, dynamic> > -
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< Value> )?, O scalar(GraphQLScalarType<Value, Map< )?, O object(GraphQLObjectType<String, dynamic> >Value> )?, O input(GraphQLInputObjectType<Value> )?, O union(GraphQLUnionType<Value> )?, O list(GraphQLListType)?, O nonNullable(GraphQLNonNullType<Value, Map< )?, required O orElse(GraphQLType)}) → OString, dynamic> > -
Similar to when, but with optional arguments and
a required default case
orElse
, which is executed when none of the provided functions match thisinherited -
whenOrNull<
O> ({O? enum_(GraphQLEnumType< Value> )?, O? scalar(GraphQLScalarType<Value, Map< )?, O? object(GraphQLObjectType<String, dynamic> >Value> )?, O? input(GraphQLInputObjectType<Value> )?, O? union(GraphQLUnionType<Value> )?, O? list(GraphQLListType)?, O? nonNullable(GraphQLNonNullType<Value, Map< )?}) → O?String, dynamic> > -
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