Skip to content
v2.274.0

CfnResolverProps Struct ​

Properties for defining a CfnResolver.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_appsync as appsync } from 'aws-cdk-lib';
const cfnResolverProps: appsync.CfnResolverProps = {
  apiId: 'apiId',
  fieldName: 'fieldName',
  typeName: 'typeName',

  // the properties below are optional
  cachingConfig: {
    ttl: 123,

    // the properties below are optional
    cachingKeys: ['cachingKeys'],
  },
  code: 'code',
  codeS3Location: 'codeS3Location',
  dataSourceName: 'dataSourceName',
  kind: 'kind',
  maxBatchSize: 123,
  metricsConfig: 'metricsConfig',
  pipelineConfig: {
    functions: ['functions'],
  },
  requestMappingTemplate: 'requestMappingTemplate',
  requestMappingTemplateS3Location: 'requestMappingTemplateS3Location',
  responseMappingTemplate: 'responseMappingTemplate',
  responseMappingTemplateS3Location: 'responseMappingTemplateS3Location',
  runtime: {
    name: 'name',
    runtimeVersion: 'runtimeVersion',
  },
  syncConfig: {
    conflictDetection: 'conflictDetection',

    // the properties below are optional
    conflictHandler: 'conflictHandler',
    lambdaConflictHandlerConfig: {
      lambdaConflictHandlerArn: 'lambdaConflictHandlerArn',
    },
  },
};

Properties ​

apiIdstringapi_idstrapiIdStringApiIdstringApiId*stringrequired#
The AWS AppSync GraphQL API to which you want to attach this resolver.
cachingConfigIResolvable | CfnResolver.CachingConfigPropertycaching_configtyping.Union[IResolvable, CachingConfigProperty]cachingConfigIResolvableCachingConfigIResolvableCachingConfiginterface{}#
The caching configuration for the resolver.
codestringcodestrcodeStringCodestringCode*string#
The `resolver` code that contains the request and response functions.

When code is used, the runtime is required. The runtime value must be APPSYNC_JS .

codeS3Locationstringcode_s3_locationstrcodeS3LocationStringCodeS3LocationstringCodeS3Location*string#
The Amazon S3 endpoint.
dataSourceNamestringdata_source_namestrdataSourceNameStringDataSourceNamestringDataSourceName*string#
The resolver data source name.
fieldNamestringfield_namestrfieldNameStringFieldNamestringFieldName*stringrequired#
The GraphQL field on a type that invokes the resolver.
kindstringkindstrkindStringKindstringKind*string#
The resolver type.
notes
  • UNIT : A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.
  • PIPELINE : A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of Function objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
maxBatchSizenumbermax_batch_sizeint | floatmaxBatchSizeNumberMaxBatchSizedoubleMaxBatchSize*float64#
The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in a `BatchInvoke` operation.
metricsConfigstringmetrics_configstrmetricsConfigStringMetricsConfigstringMetricsConfig*string#
Enables or disables enhanced resolver metrics for specified resolvers.
notes

Note that MetricsConfig won't be used unless the resolverLevelMetricsBehavior value is set to PER_RESOLVER_METRICS . If the resolverLevelMetricsBehavior is set to FULL_REQUEST_RESOLVER_METRICS instead, MetricsConfig will be ignored. However, you can still set its value.

pipelineConfigIResolvable | CfnResolver.PipelineConfigPropertypipeline_configtyping.Union[IResolvable, PipelineConfigProperty]pipelineConfigIResolvablePipelineConfigIResolvablePipelineConfiginterface{}#
Functions linked with the pipeline resolver.
requestMappingTemplatestringrequest_mapping_templatestrrequestMappingTemplateStringRequestMappingTemplatestringRequestMappingTemplate*string#
The request mapping template.

Request mapping templates are optional when using a Lambda data source. For all other data sources, a request mapping template is required.

requestMappingTemplateS3Locationstringrequest_mapping_template_s3_locationstrrequestMappingTemplateS3LocationStringRequestMappingTemplateS3LocationstringRequestMappingTemplateS3Location*string#
The location of a request mapping template in an Amazon S3 bucket.

Use this if you want to provision with a template file in Amazon S3 rather than embedding it in your CloudFormation template.

responseMappingTemplatestringresponse_mapping_templatestrresponseMappingTemplateStringResponseMappingTemplatestringResponseMappingTemplate*string#
The response mapping template.
responseMappingTemplateS3Locationstringresponse_mapping_template_s3_locationstrresponseMappingTemplateS3LocationStringResponseMappingTemplateS3LocationstringResponseMappingTemplateS3Location*string#
The location of a response mapping template in an Amazon S3 bucket.

Use this if you want to provision with a template file in Amazon S3 rather than embedding it in your CloudFormation template.

Describes a runtime used by an AWS AppSync resolver or AWS AppSync function.

Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.

syncConfigIResolvable | CfnResolver.SyncConfigPropertysync_configtyping.Union[IResolvable, SyncConfigProperty]syncConfigIResolvableSyncConfigIResolvableSyncConfiginterface{}#
The `SyncConfig` for a resolver attached to a versioned data source.
typeNamestringtype_namestrtypeNameStringTypeNamestringTypeName*stringrequired#
The GraphQL type that invokes this resolver.