evaluateMappingTemplate method
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).
May throw AccessDeniedException.
May throw BadRequestException.
May throw InternalFailureException.
Parameter context :
The map that holds all of the contextual information for your resolver
invocation. A context is required for this action.
Parameter template :
The mapping template; this can be a request or response template. A
template is required for this action.
Implementation
Future<EvaluateMappingTemplateResponse> evaluateMappingTemplate({
required String context,
required String template,
}) async {
final $payload = <String, dynamic>{
'context': context,
'template': template,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/v1/dataplane-evaluatetemplate',
exceptionFnMap: _exceptionFns,
);
return EvaluateMappingTemplateResponse.fromJson(response);
}