Module

x/graphql_deno/lib/utilities/index.js

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

Classes

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 enter(node) and leave(node).

Functions

Upholds the spec rules about naming.

Produces a GraphQL Value AST given a JavaScript object. Function will match JavaScript/JSON values to GraphQL AST schema format by using suggested GraphQLInputType. For example:

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.

Provided two composite types, determine if they "overlap". Two composite types overlap when the Sets of possible concrete types for each intersect.

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.

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.

f
getDescription
deprecated

Given an ast node, returns its string description.

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.

Build an IntrospectionQuery from a GraphQLSchema

Provided two types, return true if the types are equal (invariant).

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.

Sort GraphQLSchema.

Accepts options as a second argument:

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.

Strips characters that are not significant to the validity or execution of a GraphQL document:

  • UnicodeBOM
  • WhiteSpace
  • LineTerminator
  • Comment
  • Comma
  • BlockString indentation

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 [User], a GraphQLList instance will be returned, containing the type called "User" found in the schema. If a type called "User" is not found in the schema, then undefined will be returned.

Produces a JavaScript value given a GraphQL Value AST.

Produces a JavaScript value given a GraphQL Value AST.

Creates a new visitor instance which maintains a provided TypeInfo instance along with visiting visitor.