schema library
AST-based GraphQL Schema Type Definitions.
Adds type resolution and useful helper methods for working with graphql schema definitions, such as is useful for code generation.
The primary entrypoint is usually GraphQLSchema.fromNode(), which accepts an gql.ast.DocumentNode
NOTE: This library is currently only for working with schema definitions,
and is not a package for implementing servers like graphql_server
.
Classes
- Argument
- Arguments to Fields which accept them. FieldDefinitions are conceptually functions which return values, and occasionally accept arguments which alter their behavior.
- BooleanValue
- DefaultValue
- Directive
- Directives provide a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
- DirectiveDefinition
- Directives are used to annotate various parts of a GraphQL document as an indicator that they should be evaluated differently by a validator, executor, or client tool such as a code generator.
- EntityWithResolver
- EnumTypeDefinition
- Enum types describe the set of possible values.
- EnumValue
- EnumValueDefinition
- The literal value of an EnumTypeDefinition
- FieldDefinition
- A field describes one discrete piece of information available to request within a selection set.
- FloatValue
- GraphQLEntity
- GraphQLSchema
- / A GraphQL Schema definition without field resolution capacities.
- GraphQLType
- A Type Reference to a concrete TypeDefinition.
- InputObjectTypeDefinition
- An Input Object Type Definition
- InputValueDefinition
- Field and directive arguments accept input values of various literal primitives.
- InterfaceTypeDefinition
- Interfaces represent a list of named fields and their arguments.
- IntValue
- ListType
- A List Type wrapping another GraphQLType.
- ListValue
- NamedType
- An unqualified Named Type Reference.
- NullValue
-
ObjectField<
V extends Value> - ObjectTypeDefinition
- Definition for a GraphQL Object, which represents a list of named fields, each of which yield a value of a specific type.
- ObjectValue
- OperationTypeDefinition
- A Root Operation.
- ScalarTypeDefinition
- Scalar types represent primitive leaf values in a GraphQL type system.
- StringValue
- TypeDefinition
- The fundamental unit of any GraphQL Schema (spec).
- TypeDefinitionWithFieldSet
- InterfaceTypeDefinition and ObjectTypeDefinition both have field sets
- TypeDefinitionWithResolver
- TypeResolver
-
Enables "type resolution" for implementing classes,
allowing for type-dereferencing, such as is done by
GraphQLSchema
. - TypeSystemDefinition
- Base class of all type system definitions
- UnionTypeDefinition
- Unions represent an object that could be one of a list of GraphQL Object types (ObjectTypeDefinition), but provides for no guaranteed fields between those types.
- Value
- A literal value type
Mixins
- AbstractType
- GraphQL supports two abstract types: interfaces (InterfaceTypeDefinition) and unions (UnionTypeDefinition).
Extensions
Functions
-
buildSchema(
DocumentNode documentAST) → GraphQLSchema -
Build a GraphQLSchema from
documentNode
.
Typedefs
- ResolveType = TypeDefinition? Function(String name)
- Callback to dereference a full type definition by name