Skip to main content

Class: CdkLoader

Load resolvers into an AppSync GraphQL API construct.

import { CdkLoader } from 'aws-appsync-butler';
import { GraphqlApi } from '@aws-cdk/aws-appsync';
import { Table } from '@aws-cdk/aws-dynamodb';

const graphqlApi = new GraphqlApi(...);
const table = new Table(...);

const loader = new CdkLoader(appStack, {
api: graphqlApi,
defaultUnitResolverDataSource: table,
defaultFunctionDataSource: 'none',
variables: {
tableName: table.tableName
}
});
loader.load();

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 CdkLoader(scope, options)

Parameters

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

Inherited from

Loader<CdkLoaderOptions>.constructor

Methods

load

โ–ธ load(): void

Load on-disk resolvers and functions into AppSync.

Returns

void

Inherited from

Loader.load