GraphQLObjectType<P> constructor

GraphQLObjectType<P>(
  1. String name, {
  2. String? description,
  3. bool isInterface = false,
  4. ResolveType<GraphQLObjectType<P>>? resolveType,
  5. IsTypeOf<P>? isTypeOf,
  6. Iterable<GraphQLObjectField<Object?, Object?, P>> fields = const [],
  7. Iterable<GraphQLObjectType> interfaces = const [],
  8. 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.

Implementation

GraphQLObjectType(
  this.name, {
  this.description,
  this.isInterface = false,
  ResolveType<GraphQLObjectType<P>>? resolveType,
  IsTypeOf<P>? isTypeOf,
  Iterable<GraphQLObjectField<Object?, Object?, P>> fields = const [],
  Iterable<GraphQLObjectType> interfaces = const [],
  this.extra = const GraphQLTypeDefinitionExtra.attach([]),
})  : isTypeOf = isTypeOf == null ? null : IsTypeOfWrapper(isTypeOf),
      resolveType =
          resolveType == null ? null : ResolveTypeWrapper(resolveType) {
  this.fields.addAll(fields);

  inheritFromMany(interfaces);
}