Resolver

class aws_cdk.aws_appsync.Resolver(scope, id, *, api, data_source=None, field_name, type_name, caching_config=None, pipeline_config=None, request_mapping_template=None, response_mapping_template=None)

Bases: Construct

(experimental) An AppSync resolver.

Stability:

experimental

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) – (experimental) The API this resolver is attached to.

  • data_source (Optional[BaseDataSource]) – (experimental) The data source this resolver is using. Default: - No datasource

  • field_name (str) – (experimental) name of the GraphQL field in the given type this resolver is attached to.

  • type_name (str) – (experimental) name of the GraphQL type this resolver is attached to.

  • caching_config (Union[CachingConfig, Dict[str, Any], None]) – (experimental) The caching configuration for this resolver. Default: - No caching configuration

  • pipeline_config (Optional[Sequence[IAppsyncFunction]]) – (experimental) configuration of the pipeline resolver. Default: - no pipeline resolver configuration An empty array | undefined sets resolver to be of kind, unit

  • request_mapping_template (Optional[MappingTemplate]) – (experimental) The request mapping template for this resolver. Default: - No mapping template

  • response_mapping_template (Optional[MappingTemplate]) – (experimental) The response mapping template for this resolver. Default: - No mapping template

Stability:

experimental

Methods

to_string()

Returns a string representation of this construct.

Return type:

str

Attributes

arn

(experimental) the ARN of the resolver.

Stability:

experimental

node

The construct tree node associated with this construct.

Static Methods

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters:

x (Any) –

Return type:

bool