Class: Builder
Build a resolver tree from a VTL directory.
import { Builder } from '@appsync-butler/core';
const builder = new Builder();
builder.build();
const { getPost } = builder.resolvers.Query;
const { getUserById } = builder.functions;
Constructors
new Builder()
new Builder(
optionsOrRoot
?):Builder
Parameters
optionsOrRoot?
Path to VTL directory or parsing instructions
string
| ParserOptions
Returns
Properties
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.
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()
Methods
build()
build():
void
Traverse all the stored resolvers and functions to build the resolver tree and function dictionary.
Returns
void
buildFunctions()
protected
buildFunctions():void
Returns
void
buildResolvers()
protected
buildResolvers():void
Returns
void