resolvers
Creates, updates, deletes, gets or lists a resolvers resource.
Overview
| Name | resolvers |
| Type | Resource |
| Id | aws.appsync.resolvers |
Fields
The following fields are returned by SELECT queries:
- get_resolver
- list_resolvers
| Name | Datatype | Description |
|---|---|---|
caching_config | object | The caching configuration for a resolver that has caching activated. |
code | string | The resolver code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS. |
data_source_name | string | The resolver data source name. (pattern: <code>[_A-Za-z][_0-9A-Za-z]*</code>) |
field_name | string | The resolver field name. (pattern: <code>[_A-Za-z][_0-9A-Za-z]*</code>) |
kind | string | 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 Function objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources. (UNIT, PIPELINE) |
max_batch_size | integer | The maximum batching size for a resolver. |
metrics_config | string | Enables 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. metricsConfig can be ENABLED or DISABLED. (ENABLED, DISABLED) |
pipeline_config | object | The pipeline configuration for a resolver of kind PIPELINE. |
request_mapping_template | string | The request mapping template. (pattern: <code>^.*$</code>) |
resolver_arn | string | The resolver Amazon Resource Name (ARN). |
response_mapping_template | string | The response mapping template. (pattern: <code>^.*$</code>) |
runtime | object | Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services 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 | object | Describes a Sync configuration for a resolver. Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked. |
type_name | string | The resolver type name. (pattern: <code>[_A-Za-z][_0-9A-Za-z]*</code>) |
| Name | Datatype | Description |
|---|---|---|
caching_config | object | The caching configuration for a resolver that has caching activated. |
code | string | The resolver code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS. |
data_source_name | string | The resolver data source name. (pattern: <code>[_A-Za-z][_0-9A-Za-z]*</code>) |
field_name | string | The resolver field name. (pattern: <code>[_A-Za-z][_0-9A-Za-z]*</code>) |
kind | string | 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 Function objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources. (UNIT, PIPELINE) |
max_batch_size | integer | The maximum batching size for a resolver. |
metrics_config | string | Enables 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. metricsConfig can be ENABLED or DISABLED. (ENABLED, DISABLED) |
pipeline_config | object | The pipeline configuration for a resolver of kind PIPELINE. |
request_mapping_template | string | The request mapping template. (pattern: <code>^.*$</code>) |
resolver_arn | string | The resolver Amazon Resource Name (ARN). |
response_mapping_template | string | The response mapping template. (pattern: <code>^.*$</code>) |
runtime | object | Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services 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 | object | Describes a Sync configuration for a resolver. Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked. |
type_name | string | The resolver type name. (pattern: <code>[_A-Za-z][_0-9A-Za-z]*</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_resolver | select | api_id, type_name, field_name, region | Retrieves a Resolver object. | |
list_resolvers | select | api_id, type_name, region | nextToken, maxResults | Lists the resolvers for a given API and type. |
create_resolver | insert | api_id, type_name, region, fieldName | Creates a Resolver object. A resolver converts incoming requests into a format that a data source can understand, and converts the data source's responses into GraphQL. | |
update_resolver | update | api_id, type_name, field_name, region | Updates a Resolver object. | |
delete_resolver | delete | api_id, type_name, field_name, region | Deletes a Resolver object. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
api_id | string | The API ID. |
field_name | string | The resolver field name. |
region | string | AWS region (default: us-east-1) |
type_name | string | The name of the resolver type. |
maxResults | integer | The maximum number of results that you want the request to return. |
nextToken | string | An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list. |
SELECT examples
- get_resolver
- list_resolvers
Retrieves a Resolver object.
SELECT
caching_config,
code,
data_source_name,
field_name,
kind,
max_batch_size,
metrics_config,
pipeline_config,
request_mapping_template,
resolver_arn,
response_mapping_template,
runtime,
sync_config,
type_name
FROM aws.appsync.resolvers
WHERE api_id = '{{ api_id }}' -- required
AND type_name = '{{ type_name }}' -- required
AND field_name = '{{ field_name }}' -- required
AND region = '{{ region }}' -- required
;
Lists the resolvers for a given API and type.
SELECT
caching_config,
code,
data_source_name,
field_name,
kind,
max_batch_size,
metrics_config,
pipeline_config,
request_mapping_template,
resolver_arn,
response_mapping_template,
runtime,
sync_config,
type_name
FROM aws.appsync.resolvers
WHERE api_id = '{{ api_id }}' -- required
AND type_name = '{{ type_name }}' -- required
AND region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;
INSERT examples
- create_resolver
- Manifest
Creates a Resolver object. A resolver converts incoming requests into a format that a data source can understand, and converts the data source's responses into GraphQL.
INSERT INTO aws.appsync.resolvers (
fieldName,
dataSourceName,
requestMappingTemplate,
responseMappingTemplate,
kind,
pipelineConfig,
syncConfig,
cachingConfig,
maxBatchSize,
runtime,
code,
metricsConfig,
api_id,
type_name,
region
)
SELECT
'{{ fieldName }}' /* required */,
'{{ dataSourceName }}',
'{{ requestMappingTemplate }}',
'{{ responseMappingTemplate }}',
'{{ kind }}',
'{{ pipelineConfig }}',
'{{ syncConfig }}',
'{{ cachingConfig }}',
{{ maxBatchSize }},
'{{ runtime }}',
'{{ code }}',
'{{ metricsConfig }}',
'{{ api_id }}',
'{{ type_name }}',
'{{ region }}'
RETURNING
resolver
;
# Description fields are for documentation purposes
- name: resolvers
props:
- name: api_id
value: "{{ api_id }}"
description: Required parameter for the resolvers resource.
- name: type_name
value: "{{ type_name }}"
description: Required parameter for the resolvers resource.
- name: region
value: "{{ region }}"
description: Required parameter for the resolvers resource.
- name: fieldName
value: "{{ fieldName }}"
- name: dataSourceName
value: "{{ dataSourceName }}"
- name: requestMappingTemplate
value: "{{ requestMappingTemplate }}"
- name: responseMappingTemplate
value: "{{ responseMappingTemplate }}"
- name: kind
value: "{{ kind }}"
valid_values: ['UNIT', 'PIPELINE']
- name: pipelineConfig
description: |
The pipeline configuration for a resolver of kind PIPELINE.
value:
functions:
- "{{ functions }}"
- name: syncConfig
description: |
Describes a Sync configuration for a resolver. Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.
value:
conflictHandler: "{{ conflictHandler }}"
conflictDetection: "{{ conflictDetection }}"
lambdaConflictHandlerConfig:
lambdaConflictHandlerArn: "{{ lambdaConflictHandlerArn }}"
- name: cachingConfig
description: |
The caching configuration for a resolver that has caching activated.
value:
ttl: {{ ttl }}
cachingKeys:
- "{{ cachingKeys }}"
- name: maxBatchSize
value: {{ maxBatchSize }}
- name: runtime
description: |
Describes a runtime used by an Amazon Web Services AppSync pipeline resolver or Amazon Web Services AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.
value:
name: "{{ name }}"
runtimeVersion: "{{ runtimeVersion }}"
- name: code
value: "{{ code }}"
- name: metricsConfig
value: "{{ metricsConfig }}"
valid_values: ['ENABLED', 'DISABLED']
UPDATE examples
- update_resolver
Updates a Resolver object.
UPDATE aws.appsync.resolvers
SET
dataSourceName = '{{ dataSourceName }}',
requestMappingTemplate = '{{ requestMappingTemplate }}',
responseMappingTemplate = '{{ responseMappingTemplate }}',
kind = '{{ kind }}',
pipelineConfig = '{{ pipelineConfig }}',
syncConfig = '{{ syncConfig }}',
cachingConfig = '{{ cachingConfig }}',
maxBatchSize = {{ maxBatchSize }},
runtime = '{{ runtime }}',
code = '{{ code }}',
metricsConfig = '{{ metricsConfig }}'
WHERE
api_id = '{{ api_id }}' --required
AND type_name = '{{ type_name }}' --required
AND field_name = '{{ field_name }}' --required
AND region = '{{ region }}' --required
RETURNING
resolver;
DELETE examples
- delete_resolver
Deletes a Resolver object.
DELETE FROM aws.appsync.resolvers
WHERE api_id = '{{ api_id }}' --required
AND type_name = '{{ type_name }}' --required
AND field_name = '{{ field_name }}' --required
AND region = '{{ region }}' --required
;