Skip to main content

Class: SstLoader

Load resolvers into an SST AppSyncAPI construct.

import { SstLoader } from 'aws-appsync-butler';
import { Table, AppSyncApi } from '@serverless-stack/resources';

const table = new Table(...);

const api = new AppSyncApi(myStack, "api", {
dataSources: { myTable: { table } }
});

const loader = new SstLoader(myStack, {
api,
defaultUnitResolverDataSource: 'myTable',
defaultFunctionDataSource: 'none',
variables: {
tableName: table.dynamodbTable.tableName
}
})

Hierarchy

Properties

builder

โ€ข Readonly builder: Builder

The underlying builder instance that is responsible for building the resolver tree and function dictionary.

Inherited from

Loader.builder


functions

โ€ข Readonly functions: Record<string, AppsyncFunction> = {}

The created Appsync Functions. Only populated after loading.

Inherited from

Loader.functions

Constructors

constructor

โ€ข new SstLoader(scope, options)

Parameters

NameTypeDescription
scopeConstructA CDK construct. Usually, it is the stack instance.
optionsSstLoaderOptionsLoading, parsing, or reading directives.

Inherited from

Loader<SstLoaderOptions>.constructor

Methods

load

โ–ธ load(): void

Load on-disk resolvers and functions into AppSync.

Returns

void

Inherited from

Loader.load