Resolver
- class aws_cdk.aws_appsync.Resolver(scope, id, *, api, data_source=None, field_name, type_name, caching_config=None, code=None, max_batch_size=None, pipeline_config=None, request_mapping_template=None, response_mapping_template=None, runtime=None)
Bases:
ConstructAn AppSync resolver.
- ExampleMetadata:
infused
Example:
# api: appsync.GraphqlApi # appsync_function: appsync.AppsyncFunction pipeline_resolver = appsync.Resolver(self, "pipeline", api=api, data_source=api.add_none_data_source("none"), type_name="typeName", field_name="fieldName", request_mapping_template=appsync.MappingTemplate.from_file("beforeRequest.vtl"), pipeline_config=[appsync_function], response_mapping_template=appsync.MappingTemplate.from_file("afterResponse.vtl") )
- Parameters:
scope (
Construct)id (
str)api (
IGraphqlApi) – The API this resolver is attached to.data_source (
Optional[BaseDataSource]) – The data source this resolver is using. Default: - No datasourcefield_name (
str) – name of the GraphQL field in the given type this resolver is attached to.type_name (
str) – name of the GraphQL type this resolver is attached to.caching_config (
Union[CachingConfig,Dict[str,Any],None]) – The caching configuration for this resolver. Default: - No caching configurationcode (
Optional[Code]) – The function code. Default: - no code is usedmax_batch_size (
Union[int,float,None]) – The maximum number of elements per batch, when using batch invoke. Default: - No max batch sizepipeline_config (
Optional[Sequence[IAppsyncFunction]]) – configuration of the pipeline resolver. Default: - no pipeline resolver configuration An empty array | undefined sets resolver to be of kind, unitrequest_mapping_template (
Optional[MappingTemplate]) – The request mapping template for this resolver. Default: - No mapping templateresponse_mapping_template (
Optional[MappingTemplate]) – The response mapping template for this resolver. Default: - No mapping templateruntime (
Optional[FunctionRuntime]) – The functions runtime. Default: - no function runtime, VTL mapping templates used
Methods
- to_string()
Returns a string representation of this construct.
- Return type:
str
Attributes
- arn
the ARN of the resolver.
- node
The tree node.
Static Methods
- classmethod is_construct(x)
Checks if
xis a construct.Use this method instead of
instanceofto properly detectConstructinstances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructslibrary on disk are seen as independent, completely different libraries. As a consequence, the classConstructin each copy of theconstructslibrary is seen as a different class, and an instance of one class will not test asinstanceofthe other class.npm installwill not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructslibrary can be accidentally installed, andinstanceofwill behave unpredictably. It is safest to avoid usinginstanceof, and using this type-testing method instead.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsConstruct.