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
readonlyfunctions:Record<string,ParsedFunctionInfo>
The function dictionary object, only populated after calling build()
Keys are function names and values are parsed function information.
parser
readonlyparser:Parser
The underlying parser instance that is responsible for parsing resolvers and functions.
resolvers
readonlyresolvers: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()
protectedbuildFunctions():void
Returns
void
buildResolvers()
protectedbuildResolvers():void
Returns
void