aws-cdk-lib.aws_appsync.Resolver

class Resolver (construct)

LanguageType name
.NETAmazon.CDK.AWS.AppSync.Resolver
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsappsync#Resolver
Javasoftware.amazon.awscdk.services.appsync.Resolver
Pythonaws_cdk.aws_appsync.Resolver
TypeScript (source)aws-cdk-lib » aws_appsync » Resolver

Implements IConstruct, IDependable

An AppSync resolver.

Example

declare const api: appsync.GraphqlApi;
declare const appsyncFunction: appsync.AppsyncFunction;

const pipelineResolver = new appsync.Resolver(this, 'pipeline', {
  api,
  dataSource: api.addNoneDataSource('none'),
  typeName: 'typeName',
  fieldName: 'fieldName',
  requestMappingTemplate: appsync.MappingTemplate.fromFile('beforeRequest.vtl'),
  pipelineConfig: [appsyncFunction],
  responseMappingTemplate: appsync.MappingTemplate.fromFile('afterResponse.vtl'),
});

Initializer

new Resolver(scope: Construct, id: string, props: ResolverProps)

Parameters

  • scope Construct
  • id string
  • props ResolverProps

Construct Props

NameTypeDescription
apiIGraphqlApiThe API this resolver is attached to.
fieldNamestringname of the GraphQL field in the given type this resolver is attached to.
typeNamestringname of the GraphQL type this resolver is attached to.
cachingConfig?CachingConfigThe caching configuration for this resolver.
code?CodeThe function code.
dataSource?BaseDataSourceThe data source this resolver is using.
maxBatchSize?numberThe maximum number of elements per batch, when using batch invoke.
pipelineConfig?IAppsyncFunction[]configuration of the pipeline resolver.
requestMappingTemplate?MappingTemplateThe request mapping template for this resolver.
responseMappingTemplate?MappingTemplateThe response mapping template for this resolver.
runtime?FunctionRuntimeThe functions runtime.

api

Type: IGraphqlApi

The API this resolver is attached to.


fieldName

Type: string

name of the GraphQL field in the given type this resolver is attached to.


typeName

Type: string

name of the GraphQL type this resolver is attached to.


cachingConfig?

Type: CachingConfig (optional, default: No caching configuration)

The caching configuration for this resolver.


code?

Type: Code (optional, default: no code is used)

The function code.


dataSource?

Type: BaseDataSource (optional, default: No datasource)

The data source this resolver is using.


maxBatchSize?

Type: number (optional, default: No max batch size)

The maximum number of elements per batch, when using batch invoke.


pipelineConfig?

Type: IAppsyncFunction[] (optional, default: no pipeline resolver configuration An empty array | undefined sets resolver to be of kind, unit)

configuration of the pipeline resolver.


requestMappingTemplate?

Type: MappingTemplate (optional, default: No mapping template)

The request mapping template for this resolver.


responseMappingTemplate?

Type: MappingTemplate (optional, default: No mapping template)

The response mapping template for this resolver.


runtime?

Type: FunctionRuntime (optional, default: no function runtime, VTL mapping templates used)

The functions runtime.

Properties

NameTypeDescription
arnstringthe ARN of the resolver.
nodeNodeThe tree node.

arn

Type: string

the ARN of the resolver.


node

Type: Node

The tree node.

Methods

NameDescription
toString()Returns a string representation of this construct.

toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.