AppSync / Client / evaluate_mapping_template
evaluate_mapping_template#
- AppSync.Client.evaluate_mapping_template(**kwargs)#
Evaluates a given template and returns the response. The mapping template can be a request or response template.
Request templates take the incoming request after a GraphQL operation is parsed and convert it into a request configuration for the selected data source operation. Response templates interpret responses from the data source and map it to the shape of the GraphQL field output type.
Mapping templates are written in the Apache Velocity Template Language (VTL).
See also: AWS API Documentation
Request Syntax
response = client.evaluate_mapping_template( template='string', context='string' )
- Parameters:
template (string) –
[REQUIRED]
The mapping template; this can be a request or response template. A
template
is required for this action.context (string) –
[REQUIRED]
The map that holds all of the contextual information for your resolver invocation. A
context
is required for this action.
- Return type:
dict
- Returns:
Response Syntax
{ 'evaluationResult': 'string', 'error': { 'message': 'string' }, 'logs': [ 'string', ], 'stash': 'string', 'outErrors': 'string' }
Response Structure
(dict) –
evaluationResult (string) –
The mapping template; this can be a request or response template.
error (dict) –
The
ErrorDetail
object.message (string) –
The error payload.
logs (list) –
A list of logs that were generated by calls to
util.log.info
andutil.log.error
in the evaluated code.(string) –
stash (string) –
An object available inside each resolver and function handler. A single
stash
object lives through a single resolver run. Therefore, you can use the stash to pass arbitrary data across request and response handlers and across functions in a pipeline resolver.outErrors (string) –
The list of runtime errors that are added to the GraphQL operation response.
Exceptions
AppSync.Client.exceptions.AccessDeniedException
AppSync.Client.exceptions.InternalFailureException
AppSync.Client.exceptions.BadRequestException