Skip to main content

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

NameTypeDescription
optionsOrRoot?string | ParserOptionsPath 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