Module

x/graphql_deno/lib/language/index.js

GraphQL-JS ported to Deno
Latest
import * as mod from "https://dotland.deno.dev/x/graphql_deno@v15.0.0/lib/language/index.js";

Classes

Given a Source object, creates 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.

A representation of source input to GraphQL. name and locationOffset are optional. They are useful for clients who store GraphQL documents in source files; for example, if the GraphQL input starts at line 40 in a file named Foo.graphql, it might be useful for name to be "Foo.graphql" and location to be { line: 40, column: 0 }. line and column in locationOffset are 1-indexed

Variables

The set of allowed directive location values.

The set of allowed kind values for AST nodes.

An exported enum describing the different kinds of tokens that the lexer emits.

Functions

Takes a Source and a UTF-8 character offset, and returns the corresponding line and column as a SourceLocation.

Given a visitor instance, if it is leaving or not, and a node kind, return the function the visitor runtime should call.

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. [Int!]), parse the AST for that type. Throws GraphQLError if a syntax error is encountered.

Given a string containing a GraphQL value (ex. [42]), parse the AST for that value. Throws GraphQLError if a syntax error is encountered.

Converts an AST into a string, using one set of reasonable formatting rules.

Render a helpful description of the location in the GraphQL Source document.

Render a helpful description of the location in the GraphQL Source document.

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.