utilities library

Classes

CollectTypes
KeyAttachment
An attachment for graphQLKeyDirective that specifies that a given object can be identified by the fields passed as argument to the directive.
PossibleSelections
PossibleSelectionsField
PossibleSelectionsObject
SchemaPrinter

Extensions

DirectiveExtension on SelectionNode
ValueNodeWhen on ValueNode
Utility for executing code for each ast.ValueNode type

Constants

introspectionTypeNames → const List<String>
All introspection type names

Properties

graphQLKeyDirective GraphQLDirective
Specifies that a given Object can be identified by the fields passed as argument to the directive
final

Functions

astFromUntypedValue(Object? value) → ValueNode
astFromValue(Object? value, GraphQLType type) → ValueNode?
Returns an GraphQL Ast node from a Dart value, given the value's type
buildSchema(String schemaStr, {Map<String, Object?>? payload, SerdeCtx? serdeCtx}) GraphQLSchema
Create a GraphQLSchema from a GraphQL Schema Definition Language (SDL) String schemaStr.
collectFields(GraphQLSchema schema, Map<String, FragmentDefinitionNode> fragments, GraphQLObjectType objectType, SelectionSetNode selectionSet, Map<String, dynamic> variableValues, {Set<String>? visitedFragments, bool aliased = true}) Map<String, List<FieldNode>>
computeValue(GraphQLType? targetType, ValueNode node, Map<String, dynamic>? values) Object?
convertType(TypeNode node, Map<String, GraphQLType> customTypes) GraphQLType<Object?, Object?>
Returns a GraphQLType from a TypeNode and a map of names to types customTypes. throws GraphQLError there isn't a match.
convertTypeOrNull(TypeNode node, Map<String, GraphQLType> customTypes) GraphQLType<Object?, Object?>?
doesFragmentTypeApply(GraphQLObjectType objectType, TypeConditionNode fragmentType, GraphQLSchema schema) bool
fetchAllNamedTypes(GraphQLSchema schema) Set<GraphQLNamedType>
Returns a Set of all named types in the schema
fragmentsFromDocument(DocumentNode document) Map<String, FragmentDefinitionNode>
getDirectiveValue(String name, String argumentName, List<DirectiveNode> directives, Map<String, Object?>? variableValues, {Map<String, GraphQLDirective> directivesMap = const {}}) Object?
getIntrospectionQuery({bool descriptions = true, bool specifiedByUrl = false, bool directiveIsRepeatable = false, bool schemaDescription = false, bool inputValueDeprecation = false}) String
Return a GraphQL introspection query. Can be used against a GraphQL server to obtain information about its schema.
getNamedType(GraphQLType type) GraphQLNamedType
isAbstractType(GraphQLType type) bool
isCompositeType(GraphQLType? type) bool
isDefinedType(GraphQLNamedType type) bool
Returns true when type is a defined type, not one of the provided standard GraphQL types
isInputType(GraphQLType? type) bool
Returns true if type can be used as a GraphQL input.
isIntrospectionType(GraphQLType type) bool
Returns true if the type is an introspection type
isLeafType(GraphQLType? type) bool
isOutputType(GraphQLType? type) bool
mapDirectiveLocation(DirectiveLocation location) DirectiveLocation
mergeSelectionSets(List<SelectionNode> fields) → SelectionSetNode
possibleSelectionsCallback(GraphQLSchema schema, GraphQLObjectField field, List<FieldNode> fields, DocumentNode document, Map<String, Object?> variableValues) PossibleSelections? Function()
printAST(ValueNode node) String
printIntrospectionSchema(GraphQLSchema schema, {SchemaPrinter printer = const SchemaPrinter()}) String
Returns the Schema Definition Language (SDL) string representation of the introspection types in the given schema.
printSchema(GraphQLSchema schema, {SchemaPrinter printer = const SchemaPrinter()}) String
Returns the Schema Definition Language (SDL) string representation of the given schema.
valueFromAst(GraphQLType? type, ValueNode node, Map<String, Object?>? variables, {FileSpan? span, String key = 'value'}) Object?
Returns a Dart value from a GraphQL Ast node, given the value's type