SyntaxTree

SyntaxTree

new SyntaxTree()

A parser and processor of GraphQL IDL Abstract Syntax Trees. Used to combine
a set of GQLBase class instances.

Source:

Methods

(static) ⌾⠀from(mixed) → {SyntaxTree}

Given one of, a valid GraphQL IDL schema string, a valid GraphQL AST or
an instance of SyntaxTree, the static from() method will create a new
instance of the SyntaxTree with the values you provide.

Source:
Parameters:
Name Type Description
mixed String | Object | SyntaxTree

an instance of one of the valid
types specified above. Everything else will result in a null value.

Returns:
Type:
SyntaxTree

a newly created and populated instance of SyntaxTree
or null if an invalid type was supplied for mixed.

(static) ⎆⠀constructor(schemaOrASTOrST)

Constructs a new SyntaxTree object. If a string schema is supplied or
an already parsed AST object, either of which is valid GraphQL IDL, then
its parsed AST will be the internals of this object.

Source:
Parameters:
Name Type Description
schemaOrASTOrST string | Object | SyntaxTree

if supplied the tree
will be constructed with the contents of the data. If a string of IDL is
given, it will be parsed. If an AST is given, it will be verified. If a
SyntaxTree is supplied, it will be copied.

⌾⠀setAST(schemaOrAST) → {SyntaxTree}

Sets the underlying AST object with either schema which will be parsed
into a valid AST or an existing AST. Previous ast values will be erased.

Source:
Parameters:
Name Type Description
schemaOrAST string | Object

a valid GraphQL IDL schema or a
previosuly parsed or compatible GraphQL IDL AST object.

Returns:
Type:
SyntaxTree

this for inlining.

⬆︎⠀ast(value)

Setter that assigns the abstract syntax tree, typically created by
graphql.parse when given a valid string of IDL.

Source:
Parameters:
Name Type Description
value Object

a valid AST object. Other operations will act
in an undefined manner should this object not be a valid AST

⬇︎⠀ast() → {Object}

Getter that retrieves the abstract syntax tree created by graphql.parse
when it is presented with a valid string of IDL.

Source:
Returns:
Type:
Object

a GraphQL AST object