ExtendedResolverProps Struct
Additional property for an AppSync resolver for data source reference.
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_appsync as appsync } from 'aws-cdk-lib';
import { aws_appsync as interfaces_appsync } from 'aws-cdk-lib/interfaces';
declare const baseDataSource: appsync.BaseDataSource;
declare const code: appsync.Code;
declare const functionConfigurationRef: interfaces_appsync.IFunctionConfigurationRef;
declare const functionRuntime: appsync.FunctionRuntime;
declare const mappingTemplate: appsync.MappingTemplate;
const extendedResolverProps: appsync.ExtendedResolverProps = {
fieldName: 'fieldName',
typeName: 'typeName',
// the properties below are optional
cachingConfig: {
ttl: cdk.Duration.minutes(30),
// the properties below are optional
cachingKeys: ['cachingKeys'],
},
code: code,
dataSource: baseDataSource,
maxBatchSize: 123,
metricsConfig: appsync.ResolverMetricsConfig.ENABLED,
pipelineConfig: [functionConfigurationRef],
requestMappingTemplate: mappingTemplate,
responseMappingTemplate: mappingTemplate,
runtime: functionRuntime,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_appsync as appsync
from aws_cdk.interfaces import aws_appsync as interfaces_appsync
# base_data_source: appsync.BaseDataSource
# code: appsync.Code
# function_configuration_ref: interfaces_appsync.IFunctionConfigurationRef
# function_runtime: appsync.FunctionRuntime
# mapping_template: appsync.MappingTemplate
extended_resolver_props = appsync.ExtendedResolverProps(
field_name="fieldName",
type_name="typeName",
# the properties below are optional
caching_config=appsync.CachingConfig(
ttl=cdk.Duration.minutes(30),
# the properties below are optional
caching_keys=["cachingKeys"]
),
code=code,
data_source=base_data_source,
max_batch_size=123,
metrics_config=appsync.ResolverMetricsConfig.ENABLED,
pipeline_config=[function_configuration_ref],
request_mapping_template=mapping_template,
response_mapping_template=mapping_template,
runtime=function_runtime
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.appsync.*;
import software.amazon.awscdk.interfaces.appsync.*;
BaseDataSource baseDataSource;
Code code;
IFunctionConfigurationRef functionConfigurationRef;
FunctionRuntime functionRuntime;
MappingTemplate mappingTemplate;
ExtendedResolverProps extendedResolverProps = ExtendedResolverProps.builder()
.fieldName("fieldName")
.typeName("typeName")
// the properties below are optional
.cachingConfig(CachingConfig.builder()
.ttl(Duration.minutes(30))
// the properties below are optional
.cachingKeys(List.of("cachingKeys"))
.build())
.code(code)
.dataSource(baseDataSource)
.maxBatchSize(123)
.metricsConfig(ResolverMetricsConfig.ENABLED)
.pipelineConfig(List.of(functionConfigurationRef))
.requestMappingTemplate(mappingTemplate)
.responseMappingTemplate(mappingTemplate)
.runtime(functionRuntime)
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.AppSync;
using Amazon.CDK.Interfaces.AppSync;
BaseDataSource baseDataSource;
Code code;
IFunctionConfigurationRef functionConfigurationRef;
FunctionRuntime functionRuntime;
MappingTemplate mappingTemplate;
var extendedResolverProps = new ExtendedResolverProps {
FieldName = "fieldName",
TypeName = "typeName",
// the properties below are optional
CachingConfig = new CachingConfig {
Ttl = Duration.Minutes(30),
// the properties below are optional
CachingKeys = new [] { "cachingKeys" }
},
Code = code,
DataSource = baseDataSource,
MaxBatchSize = 123,
MetricsConfig = ResolverMetricsConfig.ENABLED,
PipelineConfig = new [] { functionConfigurationRef },
RequestMappingTemplate = mappingTemplate,
ResponseMappingTemplate = mappingTemplate,
Runtime = functionRuntime
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
var baseDataSource BaseDataSource
var code Code
var functionConfigurationRef IFunctionConfigurationRef
var functionRuntime FunctionRuntime
var mappingTemplate MappingTemplate
extendedResolverProps := &ExtendedResolverProps{
FieldName: jsii.String("fieldName"),
TypeName: jsii.String("typeName"),
// the properties below are optional
CachingConfig: &CachingConfig{
Ttl: cdk.Duration_Minutes(jsii.Number(30)),
// the properties below are optional
CachingKeys: []*string{
jsii.String("cachingKeys"),
},
},
Code: code,
DataSource: baseDataSource,
MaxBatchSize: jsii.Number(123),
MetricsConfig: awscdk.Aws_appsync.ResolverMetricsConfig_ENABLED,
PipelineConfig: []IFunctionConfigurationRef{
functionConfigurationRef,
},
RequestMappingTemplate: mappingTemplate,
ResponseMappingTemplate: mappingTemplate,
Runtime: functionRuntime,
}
Properties
cachingConfigoptionalCachingConfigcaching_configoptionalCachingConfigcachingConfigoptionalCachingConfigCachingConfigoptionalCachingConfigCachingConfigoptionalCachingConfig#The caching configuration for this resolver.
Default: No caching configuration
The function code.
Default: no code is used
dataSourceoptionalBaseDataSourcedata_sourceoptionalBaseDataSourcedataSourceoptionalBaseDataSourceDataSourceoptionalBaseDataSourceDataSourceoptionalBaseDataSource#The data source this resolver is using.
Default: No datasource
name of the GraphQL field in the given type this resolver is attached to.
maxBatchSizeoptionalnumbermax_batch_sizeoptionalint | floatmaxBatchSizeoptionalNumberMaxBatchSizeoptionaldoubleMaxBatchSizeoptional*float64#The maximum number of elements per batch, when using batch invoke.
Default: No max batch size
metricsConfigoptionalResolverMetricsConfigmetrics_configoptionalResolverMetricsConfigmetricsConfigoptionalResolverMetricsConfigMetricsConfigoptionalResolverMetricsConfigMetricsConfigoptionalResolverMetricsConfig#Whether to enable enhanced metrics Value will be ignored, if `enhancedMetricsConfig.resolverLevelMetricsBehavior` on AppSync GraphqlApi construct is set to `FULL_REQUEST_RESOLVER_METRICS`.
Default: no metrics configuration
pipelineConfigoptionalIFunctionConfigurationRef[]pipeline_configoptionaltyping.List[IFunctionConfigurationRef]pipelineConfigoptionalList<IFunctionConfigurationRef>PipelineConfigoptionalIFunctionConfigurationRef[]PipelineConfigoptional*[]IFunctionConfigurationRef#configuration of the pipeline resolver.
Default: no pipeline resolver configuration An empty array | undefined sets resolver to be of kind, unit
requestMappingTemplateoptionalMappingTemplaterequest_mapping_templateoptionalMappingTemplaterequestMappingTemplateoptionalMappingTemplateRequestMappingTemplateoptionalMappingTemplateRequestMappingTemplateoptionalMappingTemplate#The request mapping template for this resolver.
Default: No mapping template
responseMappingTemplateoptionalMappingTemplateresponse_mapping_templateoptionalMappingTemplateresponseMappingTemplateoptionalMappingTemplateResponseMappingTemplateoptionalMappingTemplateResponseMappingTemplateoptionalMappingTemplate#The response mapping template for this resolver.
Default: No mapping template
runtimeoptionalFunctionRuntimeruntimeoptionalFunctionRuntimeruntimeoptionalFunctionRuntimeRuntimeoptionalFunctionRuntimeRuntimeoptionalFunctionRuntime#The functions runtime.
Default: no function runtime, VTL mapping templates used
name of the GraphQL type this resolver is attached to.