field<T, Serialized, P> function
GraphQLObjectField<T, Serialized, P>
field<T, Serialized, P>(
- String name,
- GraphQLType<
T, Serialized> type, { - Iterable<
GraphQLFieldInput< inputs = const [],Object?, Object?> > - GraphQLFieldResolver<
T, P> ? resolve, - GraphQLSubscriptionFieldResolver<
T> ? subscribe, - String? deprecationReason,
- String? description,
- FieldDefinitionNode? astNode,
- GraphQLAttachments attachments = const [],
Shorthand for generating a GraphQLObjectField.
Implementation
GraphQLObjectField<T, Serialized, P> field<T, Serialized, P>(
String name,
GraphQLType<T, Serialized> type, {
Iterable<GraphQLFieldInput<Object?, Object?>> inputs = const [],
GraphQLFieldResolver<T, P>? resolve,
GraphQLSubscriptionFieldResolver<T>? subscribe,
String? deprecationReason,
String? description,
FieldDefinitionNode? astNode,
GraphQLAttachments attachments = const [],
}) {
return GraphQLObjectField(
name,
type,
inputs: inputs,
resolve: resolve == null ? null : FieldResolver(resolve),
subscribe: subscribe == null ? null : FieldSubscriptionResolver(subscribe),
description: description,
deprecationReason: deprecationReason,
astNode: astNode,
attachments: attachments,
);
}