Skip to main content

resolvers

Creates, updates, deletes or gets a resolver resource or lists resolvers in a region

Overview

Nameresolvers
TypeResource
DescriptionThe AWS::AppSync::Resolver resource defines the logical GraphQL resolver that you attach to fields in a schema. Request and response templates for resolvers are written in Apache Velocity Template Language (VTL) format. For more information about resolvers, see [Resolver Mapping Template Reference](https://docs.aws.amazon.com/appsync/latest/devguide/resolver-mapping-template-reference.html).
When you submit an update, CFNLong updates resources based on differences between what you submit and the stack's current template. To cause this resource to be updated you must change a property value for this resource in the CFNshort template. Changing the S3 file content without changing a property value will not result in an update operation.
See [Update Behaviors of Stack Resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html) in the *User Guide*.
Idaws.appsync.resolvers

Fields

NameDatatypeDescription
api_idstringThe APSYlong GraphQL API to which you want to attach this resolver.
caching_configobjectThe caching configuration for the resolver.
codestringThe resolver code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.
code_s3_locationstringThe Amazon S3 endpoint.
data_source_namestringThe resolver data source name.
field_namestringThe GraphQL field on a type that invokes the resolver.
kindstringThe 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 Function objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
max_batch_sizeintegerThe maximum number of resolver request inputs that will be sent to a single LAMlong function in a BatchInvoke operation.
pipeline_configobjectFunctions linked with the pipeline resolver.
request_mapping_templatestringThe 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_locationstringThe location of a request mapping template in an S3 bucket. Use this if you want to provision with a template file in S3 rather than embedding it in your CFNshort template.
resolver_arnstring
response_mapping_templatestringThe response mapping template.
response_mapping_template_s3_locationstringThe location of a response mapping template in an S3 bucket. Use this if you want to provision with a template file in S3 rather than embedding it in your CFNshort template.
runtimeobjectDescribes a runtime used by an APSYlong resolver or APSYlong function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.
sync_configobjectThe SyncConfig for a resolver attached to a versioned data source.
type_namestringThe GraphQL type that invokes this resolver.
metrics_configstringEnables or disables enhanced resolver metrics for specified resolvers. 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.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTTypeName, ApiId, FieldName, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all resolvers in a region.

SELECT
region,
api_id,
caching_config,
code,
code_s3_location,
data_source_name,
field_name,
kind,
max_batch_size,
pipeline_config,
request_mapping_template,
request_mapping_template_s3_location,
resolver_arn,
response_mapping_template,
response_mapping_template_s3_location,
runtime,
sync_config,
type_name,
metrics_config
FROM aws.appsync.resolvers
WHERE region = 'us-east-1';

Gets all properties from an individual resolver.

SELECT
region,
api_id,
caching_config,
code,
code_s3_location,
data_source_name,
field_name,
kind,
max_batch_size,
pipeline_config,
request_mapping_template,
request_mapping_template_s3_location,
resolver_arn,
response_mapping_template,
response_mapping_template_s3_location,
runtime,
sync_config,
type_name,
metrics_config
FROM aws.appsync.resolvers
WHERE region = 'us-east-1' AND data__Identifier = '<ResolverArn>';

INSERT example

Use the following StackQL query and manifest file to create a new resolver resource, using stack-deploy.

/*+ create */
INSERT INTO aws.appsync.resolvers (
ApiId,
FieldName,
TypeName,
region
)
SELECT
'{{ ApiId }}',
'{{ FieldName }}',
'{{ TypeName }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.appsync.resolvers
WHERE data__Identifier = '<ResolverArn>'
AND region = 'us-east-1';

Permissions

To operate on the resolvers resource, the following permissions are required:

Create

s3:GetObject,
appsync:CreateResolver,
appsync:GetResolver

Read

appsync:GetResolver

Update

s3:GetObject,
appsync:UpdateResolver

Delete

appsync:DeleteResolver

List

appsync:ListResolvers