GraphQL class

A Dart implementation of a GraphQL server.

Constructors

GraphQL(GraphQLSchema schema, {bool introspect = true, FutureOr<T> defaultFieldResolver<T>(T, String?, Map<String, dynamic>)?, List<GraphQLType> customTypes = const <GraphQLType>[]})

Properties

customTypes List<GraphQLType>
Any custom types to include in introspection information.
final
defaultFieldResolver → (FutureOr<T> Function<T>(T, String?, Map<String, dynamic>)?)
An optional callback that can be used to resolve fields from objects that are not Maps, when the related field has no resolver.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

coerceArgumentValues(GraphQLObjectType objectType, SelectionContext field, Map<String?, dynamic> variableValues) Map<String, dynamic>
coerceVariableValues(GraphQLSchema schema, OperationDefinitionContext operation, Map<String, dynamic> variableValues) Map<String, dynamic>
collectFields(DocumentContext document, GraphQLObjectType? objectType, SelectionSetContext selectionSet, Map<String?, dynamic> variableValues, {List? visitedFragments, GraphQLObjectType? parentType}) Map<String?, List<SelectionContext>>
completeValue(DocumentContext document, String? fieldName, GraphQLType fieldType, List<SelectionContext> fields, dynamic result, Map<String, dynamic> variableValues, Map<String, dynamic> globalVariables, {List<List> lazy = const []}) Future
convertType(TypeContext ctx, {bool usePolymorphicName = false, GraphQLObjectType? parent}) → GraphQLType
createSourceEventStream(DocumentContext document, OperationDefinitionContext subscription, GraphQLSchema schema, Map<String?, dynamic> variableValues, dynamic initialValue) Future<Stream>
doesFragmentTypeApply(GraphQLObjectType? objectType, TypeConditionContext fragmentType, {GraphQLObjectType? parentType}) bool
executeField(DocumentContext document, String? fieldName, GraphQLObjectType objectType, dynamic objectValue, List<SelectionContext> fields, GraphQLType fieldType, Map<String, dynamic> variableValues, Map<String, dynamic> globalVariables, {List<List> lazy = const []}) Future
executeMutation(DocumentContext document, OperationDefinitionContext mutation, GraphQLSchema schema, Map<String, dynamic> variableValues, dynamic initialValue, Map<String, dynamic> globalVariables) Future<Map<String?, dynamic>>
executeQuery(DocumentContext document, OperationDefinitionContext query, GraphQLSchema schema, Map<String, dynamic> variableValues, dynamic initialValue, Map<String, dynamic> globalVariables) Future<Map<String, dynamic>>
executeRequest(GraphQLSchema schema, DocumentContext document, {String? operationName, Map<String, dynamic> variableValues = const <String, dynamic>{}, dynamic initialValue, Map<String, dynamic> globalVariables = const <String, dynamic>{}}) Future
executeSelectionSet(DocumentContext document, SelectionSetContext selectionSet, GraphQLObjectType? objectType, dynamic objectValue, Map<String, dynamic> variableValues, Map<String, dynamic> globalVariables, {List<List> lazy = const [], GraphQLObjectType? parentType}) Future<Map<String, dynamic>>
executeSubscriptionEvent(DocumentContext document, OperationDefinitionContext subscription, GraphQLSchema schema, dynamic initialValue, Map<String, dynamic> variableValues, Map<String, dynamic> globalVariables) Future<Map<String, dynamic>>
getDirectiveValue(String name, String argumentName, Directives holder, Map<String?, dynamic> variableValues) → dynamic
getOperation(DocumentContext document, String? operationName) → OperationDefinitionContext
makeLazy(Map<String, dynamic> map) List<List>
mapSourceToResponseEvent(Stream sourceStream, OperationDefinitionContext subscription, GraphQLSchema schema, DocumentContext document, dynamic initialValue, Map<String, dynamic> variableValues, Map<String, dynamic> globalVariables) Stream<Map<String, dynamic>>
mergeSelectionSets(List<SelectionContext> fields) → SelectionSetContext
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseAndExecute(String text, {String? operationName, dynamic sourceUrl, Map<String, dynamic> variableValues = const {}, dynamic initialValue, Map<String, dynamic> globalVariables = const {}}) Future
resolveAbstractType(String? fieldName, GraphQLType type, dynamic result) → GraphQLObjectType
resolveFieldEventStream(GraphQLObjectType subscriptionType, dynamic rootValue, String? fieldName, Map<String, dynamic> argumentValues) Future<Stream>
resolveFieldValue<T>(GraphQLObjectType objectType, T objectValue, String? fieldName, Map<String, dynamic> argumentValues) Future<T?>
subscribe(DocumentContext document, OperationDefinitionContext subscription, GraphQLSchema schema, Map<String, dynamic> variableValues, Map<String, dynamic> globalVariables, dynamic initialValue) Future<Stream<Map<String, dynamic>>>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited