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
Loader<CdkLoaderOptions>โณ
CdkLoader
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
| Name | Type | Description |
|---|---|---|
scope | Construct | A CDK construct. Usually, it is the stack instance. |
options | CdkLoaderOptions | Loading, 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