part of graphql_schema.src.schema; typedef FutureOr GraphQLFieldResolver( Serialized serialized, Map argumentValues); class GraphQLField { final List arguments = []; final String name; final GraphQLFieldResolver resolve; final GraphQLType type; final String deprecationReason; GraphQLField(this.name, {Iterable arguments: const [], @required this.resolve, this.type, this.deprecationReason}) { this.arguments.addAll(arguments ?? []); } bool get isDeprecated => deprecationReason?.isNotEmpty == true; FutureOr serialize(Value value) { return type.serialize(value); } FutureOr deserialize(Serialized serialized, [Map argumentValues = const {}]) { if (resolve != null) return resolve(serialized, argumentValues); return type.deserialize(serialized); } }