Skip to content

Commit 990cffa

Browse files
author
AWS
committed
AWS AppSync Update: Adds support for a new API to evaluate mapping templates with mock data, allowing you to remotely unit test your AppSync resolvers and functions.
1 parent bc61b33 commit 990cffa

File tree

2 files changed

+82
-2
lines changed

2 files changed

+82
-2
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "feature",
3+
"category": "AWS AppSync",
4+
"contributor": "",
5+
"description": "Adds support for a new API to evaluate mapping templates with mock data, allowing you to remotely unit test your AppSync resolvers and functions."
6+
}

services/appsync/src/main/resources/codegen-resources/service-2.json

Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,21 @@
316316
],
317317
"documentation":"<p>Removes an <code>ApiAssociation</code> object from a custom domain.</p>"
318318
},
319+
"EvaluateMappingTemplate":{
320+
"name":"EvaluateMappingTemplate",
321+
"http":{
322+
"method":"POST",
323+
"requestUri":"/v1/dataplane-evaluatetemplate"
324+
},
325+
"input":{"shape":"EvaluateMappingTemplateRequest"},
326+
"output":{"shape":"EvaluateMappingTemplateResponse"},
327+
"errors":[
328+
{"shape":"AccessDeniedException"},
329+
{"shape":"InternalFailureException"},
330+
{"shape":"BadRequestException"}
331+
],
332+
"documentation":"<p>Evaluates a given template and returns the response. The mapping template can be a request or response template.</p> <p>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.</p> <p>Mapping templates are written in the Apache Velocity Template Language (VTL).</p>"
333+
},
319334
"FlushApiCache":{
320335
"name":"FlushApiCache",
321336
"http":{
@@ -1101,6 +1116,7 @@
11011116
"BooleanValue":{"type":"boolean"},
11021117
"CachingConfig":{
11031118
"type":"structure",
1119+
"required":["ttl"],
11041120
"members":{
11051121
"ttl":{
11061122
"shape":"Long",
@@ -1140,7 +1156,7 @@
11401156
},
11411157
"appIdClientRegex":{
11421158
"shape":"String",
1143-
"documentation":"<p>A regular expression for validating the incoming Amazon Cognito user pool app client ID.</p>"
1159+
"documentation":"<p>A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.</p>"
11441160
}
11451161
},
11461162
"documentation":"<p>Describes an Amazon Cognito user pool configuration.</p>"
@@ -1170,6 +1186,12 @@
11701186
"NONE"
11711187
]
11721188
},
1189+
"Context":{
1190+
"type":"string",
1191+
"max":28000,
1192+
"min":2,
1193+
"pattern":"^[\\s\\S]*$"
1194+
},
11731195
"CreateApiCacheRequest":{
11741196
"type":"structure",
11751197
"required":[
@@ -1939,7 +1961,53 @@
19391961
},
19401962
"documentation":"<p>Describes an OpenSearch data source configuration.</p> <p>As of September 2021, Amazon Elasticsearch service is Amazon OpenSearch Service. This configuration is deprecated. For new data sources, use <a>OpenSearchServiceDataSourceConfig</a> to specify an OpenSearch data source.</p>"
19411963
},
1964+
"ErrorDetail":{
1965+
"type":"structure",
1966+
"members":{
1967+
"message":{
1968+
"shape":"ErrorMessage",
1969+
"documentation":"<p>The error payload.</p>"
1970+
}
1971+
},
1972+
"documentation":"<p>Contains the list of errors generated when attempting to evaluate a mapping template.</p>"
1973+
},
19421974
"ErrorMessage":{"type":"string"},
1975+
"EvaluateMappingTemplateRequest":{
1976+
"type":"structure",
1977+
"required":[
1978+
"template",
1979+
"context"
1980+
],
1981+
"members":{
1982+
"template":{
1983+
"shape":"Template",
1984+
"documentation":"<p>The mapping template; this can be a request or response template. A <code>template</code> is required for this action.</p>"
1985+
},
1986+
"context":{
1987+
"shape":"Context",
1988+
"documentation":"<p>The map that holds all of the contextual information for your resolver invocation. A <code>context</code> is required for this action.</p>"
1989+
}
1990+
}
1991+
},
1992+
"EvaluateMappingTemplateResponse":{
1993+
"type":"structure",
1994+
"members":{
1995+
"evaluationResult":{
1996+
"shape":"EvaluationResult",
1997+
"documentation":"<p>The mapping template; this can be a request or response template.</p>"
1998+
},
1999+
"error":{
2000+
"shape":"ErrorDetail",
2001+
"documentation":"<p>The <code>ErrorDetail</code> object.</p>"
2002+
}
2003+
}
2004+
},
2005+
"EvaluationResult":{
2006+
"type":"string",
2007+
"max":65536,
2008+
"min":0,
2009+
"pattern":"^[\\s\\S]*$"
2010+
},
19432011
"FieldLogLevel":{
19442012
"type":"string",
19452013
"enum":[
@@ -3122,6 +3190,12 @@
31223190
"max":256,
31233191
"pattern":"^[\\s\\w+-=\\.:/@]*$"
31243192
},
3193+
"Template":{
3194+
"type":"string",
3195+
"max":65536,
3196+
"min":2,
3197+
"pattern":"^[\\s\\S]*$"
3198+
},
31253199
"Type":{
31263200
"type":"structure",
31273201
"members":{
@@ -3612,7 +3686,7 @@
36123686
},
36133687
"appIdClientRegex":{
36143688
"shape":"String",
3615-
"documentation":"<p>A regular expression for validating the incoming Amazon Cognito user pool app client ID.</p>"
3689+
"documentation":"<p>A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.</p>"
36163690
}
36173691
},
36183692
"documentation":"<p>Describes an Amazon Cognito user pool configuration.</p>"

0 commit comments

Comments
 (0)