field<T, Serialized, P> function

GraphQLObjectField<T, Serialized, P> field<T, Serialized, P>(
  1. String name,
  2. GraphQLType<T, Serialized> type, {
  3. Iterable<GraphQLFieldInput<Object?, Object?>> inputs = const [],
  4. GraphQLFieldResolver<T, P>? resolve,
  5. GraphQLSubscriptionFieldResolver<T>? subscribe,
  6. String? deprecationReason,
  7. String? description,
  8. FieldDefinitionNode? astNode,
  9. 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,
  );
}