Class: Builder
Build a resolver tree from a VTL directory.
import { Builder } from 'aws-appsync-butler';
const builder = new Builder();
builder.build();
const { getPost } = builder.resolvers.Query;
const { getUserById } = builder.functions;
Constructors
constructor
โข new Builder(optionsOrRoot?)
Parameters
| Name | Type | Description |
|---|---|---|
optionsOrRoot? | string | ParserOptions | Path to VTL directory or parsing instructions |
Properties
parser
โข Readonly parser: Parser
The underlying parser instance that is responsible for parsing resolvers and functions.
resolvers
โข Readonly resolvers: ResolverTree
The resolver tree object, only populated after calling build()
functions
โข Readonly functions: Record<string, ParsedFunctionInfo>
The function dictionary object, only populated after calling build()
Keys are function names and values are parsed function information.
Methods
build
โธ build(): void
Traverse all the stored resolvers and functions to build the resolver tree and function dictionary.
Returns
void