import { GraphQL } from "https://deno.land/x/drash@v2.8.1/src/services/graphql/graphql.ts";
Classes
Directives are used by the GraphQL runtime as a way of modifying execution behavior. Type system creators will usually not create these directly. | |
Enum Type Definition | |
A GraphQLError describes an Error found during the parse, validate, or execute phases of performing a GraphQL operation. In addition to a message and stack trace, it also includes information about the locations in a GraphQL document and/or execution result that correspond to the Error. | |
Input Object Type Definition | |
Interface Type Definition | |
Object Type Definition | |
Scalar Type Definition | |
Schema Definition | |
Union Type Definition | |
Given a Source object, this returns a Lexer for that source. A Lexer is a stateful stream generator in that every time it is advanced, it returns the next token in the Source. Assuming the source lexes, the final Token emitted by the lexer will be of kind EOF, after which the lexer will repeatedly return the same EOF token whenever called. | |
Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived. | |
A representation of source input to GraphQL. The | |
Represents a range of characters represented by a lexical token within a Source. | |
TypeInfo is a utility class which, given a GraphQL schema, can keep track
of the current field and type definitions at any point in a GraphQL document
AST during a recursive descent by calling | |
Variables
Constant string used for default reason for a deprecation. | |
If a resolve function is not given, then a default resolve behavior is used which takes the property of the source object of the same name as the field and returns it as the result, or if it's a function, returns the result of calling that function while passing along args and context. | |
If a resolveType function is not given, then a default resolve behavior is used which attempts two strategies: | |
The set of allowed directive location values. | |
Used to declare element of a GraphQL schema as deprecated. | |
Used to conditionally include fields or fragments. | |
Used to conditionally skip (exclude) fields or fragments. | |
Used to provide a URL for specifying the behavior of custom scalar definitions. | |
The set of allowed kind values for AST nodes. | |
Note that these are GraphQLField and not GraphQLFieldConfig, so the format for args is different. | |
The full list of specified directives. | |
This set includes all validation rules defined by the GraphQL spec. | |
An exported enum describing the different kinds of tokens that the lexer emits. | |
A string containing the version of the GraphQL.js library | |
An object containing the components of the GraphQL.js version string |
Functions
Upholds the spec rules about naming. | |
Utility function which asserts a schema is valid by throwing an error if it is invalid. | |
Produces a GraphQL Value AST given a JavaScript value. | |
This takes the ast of a schema document produced by the parse function in src/language/parser.js. | |
Build a GraphQLSchema for use by client tools. | |
A helper function to build a GraphQLSchema directly from a source document. | |
Coerces a JavaScript value given a GraphQL Input Type. | |
Provided a collection of ASTs, presumably each from different files, concatenate the ASTs together into batched AST, useful for validating many GraphQL source files which together represent one conceptual application. | |
Implements the "CreateSourceEventStream" algorithm described in the GraphQL specification, resolving the subscription source event stream. | |
Provided two composite types, determine if they "overlap". Two composite types overlap when the Sets of possible concrete types for each intersect. | |
Executable definitions | |
Implements the "Evaluating requests" section of the GraphQL specification. | |
Also implements the "Evaluating requests" section of the GraphQL specification. However, it guarantees to complete synchronously (or throw an error) assuming that all field resolvers are also synchronous. | |
Produces a new schema given an existing schema and a document which may contain GraphQL type extensions and definitions. The original schema will remain unaltered. | |
Fields on correct type | |
Given two schemas, returns an Array containing descriptions of all the types of breaking changes covered by the other functions down below. | |
Given two schemas, returns an Array containing descriptions of all the types of potentially dangerous changes covered by the other functions down below. | |
A validation rule which reports deprecated usages. | |
Given a GraphQLError, format it according to the rules described by the Response Format, Errors section of the GraphQL Specification. | |
Fragments on composite type | |
Given an ast node, returns its string description. | |
Prepares an object map of argument values given a directive definition and a AST node which may contain directives. Optionally also accepts a map of variable values. | |
Takes a Source and a UTF-8 character offset, and returns the corresponding line and column as a SourceLocation. | |
Returns an operation AST given a document AST and optionally an operation name. If a name is not provided, an operation is only returned if only one is provided in the document. | |
Extracts the root type of the operation from the schema. | |
Given a visitor instance, if it is leaving or not, and a node kind, return the function the visitor runtime should call. | |
The graphqlSync function also fulfills GraphQL operations by parsing, validating, and executing a GraphQL document along side a GraphQL schema. However, it guarantees to complete synchronously (or throw an error) assuming that all field resolvers are also synchronous. | |
Build an IntrospectionQuery from a GraphQLSchema | |
Test if the given value is a GraphQL directive. | |
Provided two types, return true if the types are equal (invariant). | |
Test if the given value is a GraphQL schema. | |
Provided a type and a super type, return true if the first type is either equal or a subset of the second super type (covariant). | |
Returns an Error if a name is invalid. | |
Known argument names | |
Known directives | |
Known fragment names | |
Known type names | |
Sort GraphQLSchema. | |
Given an arbitrary value, presumably thrown while attempting to execute a GraphQL operation, produce a new GraphQLError aware of the location in the document responsible for the original Error. | |
Lone anonymous operation | |
Lone Schema definition | |
No deprecated | |
Prohibit introspection queries | |
No undefined variables | |
No unused fragments | |
No unused variables | |
Overlapping fields can be merged | |
Given a GraphQL source, parses it into a Document. Throws GraphQLError if a syntax error is encountered. | |
Given a string containing a GraphQL Type (ex. | |
Given a string containing a GraphQL value, parse the AST for that value. Throws GraphQLError if a syntax error is encountered. | |
Possible fragment spread | |
Possible type extension | |
Converts an AST into a string, using one set of reasonable formatting rules. | |
Prints a GraphQLError to a string, representing useful location information about the error's position in the source. | |
Render a helpful description of the location in the GraphQL Source document. | |
Accepts options as a second argument: | |
Render a helpful description of the location in the GraphQL Source document. | |
Provided required arguments | |
Given a Path, return an Array of the path keys. | |
Scalar leafs | |
separateOperations accepts a single AST document which may contain many operations and fragments and returns a collection of AST documents each of which contains a single operation as well the fragment definitions it refers to. | |
Subscriptions must only include one field. | |
Strips characters that are not significant to the validity or execution of a GraphQL document:
| |
Implements the "Subscribe" algorithm described in the GraphQL specification. | |
Produces a GraphQLError representing a syntax error, containing useful descriptive information about the syntax error's position in the source. | |
Given a Schema and an AST node describing a type, return a GraphQLType
definition which applies to that type. For example, if provided the parsed
AST node for | |
Unique argument names | |
Unique directive names | |
Unique directive names per location | |
Unique enum value names | |
Unique field definition names | |
Unique fragment names | |
Unique input field names | |
Unique operation names | |
Unique operation types | |
Unique type names | |
Unique variable names | |
Implements the "Validation" section of the spec. | |
Implements the "Type Validation" sub-sections of the specification's "Type System" section. | |
Produces a JavaScript value given a GraphQL Value AST. | |
Produces a JavaScript value given a GraphQL Value AST. | |
Value literals of correct type | |
Variables are input types | |
Variables passed to field arguments conform to type | |
visit() will walk through an AST using a depth-first traversal, calling the visitor's enter function at each node in the traversal, and calling the leave function after visiting that node and all of its child nodes. | |
Creates a new visitor instance which delegates to many visitors to run in parallel. Each visitor will be visited for each node before moving on. | |
Creates a new visitor instance which maintains a provided TypeInfo instance along with visiting visitor. |
Interfaces
Utility type listing all nodes indexed by their kind. | |
The result of GraphQL execution. | |
This is the primary entry point function for fulfilling GraphQL operations by parsing, validating, and executing a GraphQL document along side a GraphQL schema. | |
Custom extensions | |
Custom extensions | |
Custom extensions | |
Custom extensions | |
Custom extensions | |
Custom extensions | |
Custom extensions | |
Custom extensions | |
Custom extensions | |
Custom extensions | |
Custom extensions | |
Custom extensions | |
Configuration options to control parser behavior | |
Represents a location in a Source. | |
Wrapper type that contains DocumentNode and types that can be deduced from it. | |
Type Aliases
The list of all possible AST node types. | |
A visitor is provided to visit, it contains the collection of relevant functions to be called during the visitor's traversal. | |
The enum type representing the directive location values. | |
These types may describe the parent context of a selection set. | |
These types may describe the parent context of a selection set. | |
These types may be used as input types for arguments and directives. | |
These types may describe types which may be leaf values. | |
These named types do not include modifiers like List or NonNull. | |
These types can all accept null as a value. | |
These types may be used as output types as the result of fields. | |
These are all of the possible kinds of types. | |
The enum type representing the possible kind values of AST nodes. | |
Used while defining GraphQL types to allow for circular references in otherwise immutable type definitions. | |
The enum type representing the token kinds values. | |
A visitor is comprised of visit functions, which are called on each node during the visitor's traversal. | |
A KeyMap describes each the traversable properties of each kind of node. |