SyntaxTree
SyntaxTree
new SyntaxTree()
A parser and processor of GraphQL IDL Abstract Syntax Trees. Used to combine
a set of GQLBase
class instances.
- Source:
- SyntaxTree.js, line 61
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.
Parameters:
Name | Type | Description |
---|---|---|
mixed |
String | Object | SyntaxTree | an instance of one of the valid |
Returns:
(
SyntaxTree
)
a newly created and populated instance of SyntaxTree
or null if an invalid type was supplied for mixed.
- Source:
- SyntaxTree.js, line 529
(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.
Parameters:
Name | Type | Description |
---|---|---|
schemaOrASTOrST |
string | Object | SyntaxTree | if supplied the tree |
- Source:
- SyntaxTree.js, line 69
⌾⠀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.
Parameters:
Name | Type | Description |
---|---|---|
schemaOrAST |
string | Object | a valid GraphQL IDL schema or a |
Returns:
(
SyntaxTree
)
this for inlining.
- Source:
- SyntaxTree.js, line 110
⬆︎⠀ast(value)
Setter that assigns the abstract syntax tree, typically created bygraphql.parse
when given a valid string of IDL.
Parameters:
Name | Type | Description |
---|---|---|
value |
Object | a valid AST object. Other operations will act |
- Source:
- SyntaxTree.js, line 477
⬇︎⠀ast() → {Object}
Getter that retrieves the abstract syntax tree created by graphql.parse
when it is presented with a valid string of IDL.
Returns:
(
Object
)
a GraphQL AST object
- Source:
- SyntaxTree.js, line 94