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 |
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 |
⌾⠀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 |
⬆︎⠀ast(value)
Setter that assigns the abstract syntax tree, typically created bygraphql.parse
when given a valid string of IDL.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
value |
Object
|
a valid AST object. Other operations will act |
⬇︎⠀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