CfnResolverProps
- class aws_cdk.aws_appsync.CfnResolverProps(*, api_id, field_name, type_name, caching_config=None, code=None, code_s3_location=None, data_source_name=None, kind=None, max_batch_size=None, metrics_config=None, pipeline_config=None, request_mapping_template=None, request_mapping_template_s3_location=None, response_mapping_template=None, response_mapping_template_s3_location=None, runtime=None, sync_config=None)
Bases:
objectProperties for defining a
CfnResolver.- Parameters:
api_id (
str) – The AWS AppSync GraphQL API to which you want to attach this resolver.field_name (
str) – The GraphQL field on a type that invokes the resolver.type_name (
str) – The GraphQL type that invokes this resolver.caching_config (
Union[IResolvable,CachingConfigProperty,Dict[str,Any],None]) – The caching configuration for the resolver.code (
Optional[str]) – Theresolvercode that contains the request and response functions. When code is used, theruntimeis required. The runtime value must beAPPSYNC_JS.code_s3_location (
Optional[str]) – The Amazon S3 endpoint.data_source_name (
Optional[str]) – The resolver data source name.kind (
Optional[str]) – The resolver type. - 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 ofFunctionobjects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.max_batch_size (
Union[int,float,None]) – The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in aBatchInvokeoperation.metrics_config (
Optional[str]) – Enables or disables enhanced resolver metrics for specified resolvers. Note thatMetricsConfigwon’t be used unless theresolverLevelMetricsBehaviorvalue is set toPER_RESOLVER_METRICS. If theresolverLevelMetricsBehavioris set toFULL_REQUEST_RESOLVER_METRICSinstead,MetricsConfigwill be ignored. However, you can still set its value.pipeline_config (
Union[IResolvable,PipelineConfigProperty,Dict[str,Any],None]) – Functions linked with the pipeline resolver.request_mapping_template (
Optional[str]) – 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.request_mapping_template_s3_location (
Optional[str]) – 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.response_mapping_template (
Optional[str]) – The response mapping template.response_mapping_template_s3_location (
Optional[str]) – 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.runtime (
Union[IResolvable,AppSyncRuntimeProperty,Dict[str,Any],None]) – 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.sync_config (
Union[IResolvable,SyncConfigProperty,Dict[str,Any],None]) – TheSyncConfigfor a resolver attached to a versioned data source.
- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-resolver.html
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_appsync as appsync cfn_resolver_props = appsync.CfnResolverProps( api_id="apiId", field_name="fieldName", type_name="typeName", # the properties below are optional caching_config=appsync.CfnResolver.CachingConfigProperty( ttl=123, # the properties below are optional caching_keys=["cachingKeys"] ), code="code", code_s3_location="codeS3Location", data_source_name="dataSourceName", kind="kind", max_batch_size=123, metrics_config="metricsConfig", pipeline_config=appsync.CfnResolver.PipelineConfigProperty( functions=["functions"] ), request_mapping_template="requestMappingTemplate", request_mapping_template_s3_location="requestMappingTemplateS3Location", response_mapping_template="responseMappingTemplate", response_mapping_template_s3_location="responseMappingTemplateS3Location", runtime=appsync.CfnResolver.AppSyncRuntimeProperty( name="name", runtime_version="runtimeVersion" ), sync_config=appsync.CfnResolver.SyncConfigProperty( conflict_detection="conflictDetection", # the properties below are optional conflict_handler="conflictHandler", lambda_conflict_handler_config=appsync.CfnResolver.LambdaConflictHandlerConfigProperty( lambda_conflict_handler_arn="lambdaConflictHandlerArn" ) ) )
Attributes
- api_id
The AWS AppSync GraphQL API to which you want to attach this resolver.
- caching_config
The caching configuration for the resolver.
- code
The
resolvercode that contains the request and response functions.When code is used, the
runtimeis required. The runtime value must beAPPSYNC_JS.
- code_s3_location
The Amazon S3 endpoint.
- data_source_name
The resolver data source name.
- field_name
The GraphQL field on a type that invokes the resolver.
- kind
The resolver type.
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
Functionobjects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
- max_batch_size
The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in a
BatchInvokeoperation.
- metrics_config
Enables or disables enhanced resolver metrics for specified resolvers.
Note that
MetricsConfigwon’t be used unless theresolverLevelMetricsBehaviorvalue is set toPER_RESOLVER_METRICS. If theresolverLevelMetricsBehavioris set toFULL_REQUEST_RESOLVER_METRICSinstead,MetricsConfigwill be ignored. However, you can still set its value.
- pipeline_config
Functions linked with the pipeline resolver.
- request_mapping_template
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.
- request_mapping_template_s3_location
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.
- response_mapping_template
The response mapping template.
- response_mapping_template_s3_location
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.
- runtime
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.
- sync_config
The
SyncConfigfor a resolver attached to a versioned data source.
- type_name
The GraphQL type that invokes this resolver.