Skip to content
This repository was archived by the owner on Jul 26, 2022. It is now read-only.

Latest commit

 

History

History
236 lines (124 loc) · 9.75 KB

File metadata and controls

236 lines (124 loc) · 9.75 KB

API Reference

Classes

Name Description
AppSyncTransformer AppSyncTransformer Construct.

Structs

Name Description
AppSyncTransformerProps No description
CdkTransformerFunctionResolver No description
CdkTransformerGlobalSecondaryIndex No description
CdkTransformerHttpResolver No description
CdkTransformerResolver No description
CdkTransformerTable No description
CdkTransformerTableKey No description
CdkTransformerTableTtl No description
SchemaTransformerOutputs No description

class AppSyncTransformer 🔹

AppSyncTransformer Construct.

Implements: IConstruct, IConstruct, IConstruct, IDependable Extends: Construct

Initializer

new AppSyncTransformer(scope: Construct, id: string, props: AppSyncTransformerProps)
  • scope (Construct) No description
  • id (string) No description
  • props (AppSyncTransformerProps) No description
    • schemaPath (string) Relative path where schema.graphql exists.
    • apiName (string) String value representing the api name. Default: ${id}-api
    • authorizationConfig (AuthorizationConfig) Optional. Default: API_KEY authorization config
    • fieldLogLevel (FieldLogLevel) Optional. Default: FieldLogLevel.NONE
    • syncEnabled (boolean) Whether to enable Amplify DataStore and Sync Tables. Default: false
    • xrayEnabled (boolean) Determines whether xray should be enabled on the AppSync API. Default: false

Properties

Name Type Description
appsyncAPI🔹 GraphqlApi The cdk GraphqlApi construct.
functionResolvers🔹 Map<string, Array<CdkTransformerFunctionResolver>> The Lambda Function resolvers designated by the function directive https://github.com/kcwinner/cdk-appsync-transformer#functions.
httpResolvers🔹 Map<string, Array<CdkTransformerHttpResolver>>
nestedAppsyncStack🔹 NestedStack The NestedStack that contains the AppSync resources.
outputs🔹 SchemaTransformerOutputs The outputs from the SchemaTransformer.
resolvers🔹 any The AppSync resolvers from the transformer minus any function resolvers.
tableNameMap🔹 Map<string, any> Map of cdk table tokens to table names.

Methods

addLambdaDataSourceAndResolvers(functionName, id, lambdaFunction, options?)🔹

Adds the function as a lambdaDataSource to the AppSync api Adds all of the functions resolvers to the AppSync api.

addLambdaDataSourceAndResolvers(functionName: string, id: string, lambdaFunction: IFunction, options?: DataSourceOptions): LambdaDataSource
  • functionName (string) The function name specified in the.
  • id (string) The id to give.
  • lambdaFunction (IFunction) The lambda function to attach.
  • options (DataSourceOptions) No description
    • description (string) The description of the data source. Default: No description
    • name (string) The name of the data source, overrides the id given by cdk. Default: generated by cdk given the id

Returns:

struct AppSyncTransformerProps 🔹

Name Type Description
schemaPath🔹 string Relative path where schema.graphql exists.
apiName?🔹 string String value representing the api name.
Default: ${id}-api
authorizationConfig?🔹 AuthorizationConfig Optional.
Default: API_KEY authorization config
fieldLogLevel?🔹 FieldLogLevel Optional.
Default: FieldLogLevel.NONE
syncEnabled?🔹 boolean Whether to enable Amplify DataStore and Sync Tables.
Default: false
xrayEnabled?🔹 boolean Determines whether xray should be enabled on the AppSync API.
Default: false

struct CdkTransformerFunctionResolver 🔹

Name Type Description
defaultRequestMappingTemplate🔹 string
defaultResponseMappingTemplate🔹 string
fieldName🔹 string
typeName🔹 string

struct CdkTransformerGlobalSecondaryIndex 🔹

Name Type Description
indexName🔹 string
partitionKey🔹 CdkTransformerTableKey
projection🔹 any
sortKey🔹 CdkTransformerTableKey

struct CdkTransformerHttpResolver 🔹

Name Type Description
defaultRequestMappingTemplate🔹 string
defaultResponseMappingTemplate🔹 string
fieldName🔹 string
httpConfig🔹 any
typeName🔹 string

struct CdkTransformerResolver 🔹

Name Type Description
fieldName🔹 string
typeName🔹 string

struct CdkTransformerTable 🔹

Name Type Description
globalSecondaryIndexes🔹 Array<CdkTransformerGlobalSecondaryIndex>
gsiResolvers🔹 Array
partitionKey🔹 CdkTransformerTableKey
resolvers🔹 Array
tableName🔹 string
sortKey?🔹 CdkTransformerTableKey Optional
ttl?🔹 CdkTransformerTableTtl Optional

struct CdkTransformerTableKey 🔹

Name Type Description
name🔹 string
type🔹 string

struct CdkTransformerTableTtl 🔹

Name Type Description
attributeName🔹 string
enabled🔹 boolean

struct SchemaTransformerOutputs 🔹

Name Type Description
cdkTables?🔹 Map<string, CdkTransformerTable> Optional
functionResolvers?🔹 Map<string, Array<CdkTransformerFunctionResolver>> Optional
httpResolvers?🔹 Map<string, Array<CdkTransformerHttpResolver>> Optional
mutations?🔹 Map<string, CdkTransformerResolver> Optional
noneResolvers?🔹 Map<string, CdkTransformerResolver> Optional
queries?🔹 Map<string, string> Optional
subscriptions?🔹 Map<string, CdkTransformerResolver> Optional