Skip to content

Commit 3a9f206

Browse files
authoredDec 10, 2021
fix(appsync): empty caching config is created when not provided (#17947)
If the `cachingConfig` property is not provided, the library is generating an empty config. Change this to not add any config to the template. Related to #17925. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent f02fcb4 commit 3a9f206

9 files changed

+27
-44
lines changed
 

‎packages/@aws-cdk/aws-appsync/lib/resolver.ts

+9-4
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,20 @@ export class Resolver extends CoreConstruct {
114114
pipelineConfig: pipelineConfig,
115115
requestMappingTemplate: props.requestMappingTemplate ? props.requestMappingTemplate.renderTemplate() : undefined,
116116
responseMappingTemplate: props.responseMappingTemplate ? props.responseMappingTemplate.renderTemplate() : undefined,
117-
cachingConfig: {
118-
cachingKeys: props.cachingConfig?.cachingKeys,
119-
ttl: props.cachingConfig?.ttl?.toSeconds(),
120-
},
117+
cachingConfig: this.createCachingConfig(props.cachingConfig),
121118
});
122119
props.api.addSchemaDependency(this.resolver);
123120
if (props.dataSource) {
124121
this.resolver.addDependsOn(props.dataSource.ds);
125122
}
126123
this.arn = this.resolver.attrResolverArn;
127124
}
125+
126+
private createCachingConfig(config?: CachingConfig) {
127+
return config ? {
128+
cachingKeys: config.cachingKeys,
129+
ttl: config.ttl?.toSeconds(),
130+
} : undefined;
131+
}
132+
128133
}

‎packages/@aws-cdk/aws-appsync/test/appsync-caching-config.test.ts

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as path from 'path';
2-
import { Template } from '@aws-cdk/assertions';
2+
import { Match, Template } from '@aws-cdk/assertions';
33
import * as lambda from '@aws-cdk/aws-lambda';
44
import * as cdk from '@aws-cdk/core';
55
import { Duration } from '@aws-cdk/core';
@@ -29,6 +29,23 @@ describe('Lambda caching config', () => {
2929
});
3030
});
3131

32+
test('Lambda resolver can be created without caching config', () => {
33+
// WHEN
34+
const lambdaDS = api.addLambdaDataSource('LambdaDS', func);
35+
36+
lambdaDS.createResolver({
37+
typeName: 'Query',
38+
fieldName: 'allPosts',
39+
});
40+
41+
// THEN
42+
Template.fromStack(stack).hasResourceProperties('AWS::AppSync::Resolver', {
43+
TypeName: 'Query',
44+
FieldName: 'allPosts',
45+
CachingConfig: Match.absent(),
46+
});
47+
});
48+
3249
test('Lambda resolver contains caching config with caching key and TTL', () => {
3350
// WHEN
3451
const lambdaDS = api.addLambdaDataSource('LambdaDS', func);

‎packages/@aws-cdk/aws-appsync/test/integ.api-import.expected.json

-3
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@
143143
},
144144
"FieldName": "getTests",
145145
"TypeName": "Query",
146-
"CachingConfig": {},
147146
"DataSourceName": "ds",
148147
"Kind": "UNIT",
149148
"RequestMappingTemplate": "{\"version\" : \"2017-02-28\", \"operation\" : \"Scan\"}",
@@ -161,7 +160,6 @@
161160
},
162161
"FieldName": "addTest",
163162
"TypeName": "Mutation",
164-
"CachingConfig": {},
165163
"DataSourceName": "ds",
166164
"Kind": "UNIT",
167165
"RequestMappingTemplate": "\n #set($input = $ctx.args.test)\n \n {\n \"version\": \"2017-02-28\",\n \"operation\": \"PutItem\",\n \"key\" : {\n \"id\" : $util.dynamodb.toDynamoDBJson($util.autoId())\n },\n \"attributeValues\": $util.dynamodb.toMapValuesJson($input)\n }",
@@ -225,7 +223,6 @@
225223
},
226224
"FieldName": "version",
227225
"TypeName": "test",
228-
"CachingConfig": {},
229226
"Kind": "PIPELINE",
230227
"PipelineConfig": {
231228
"Functions": [

‎packages/@aws-cdk/aws-appsync/test/integ.appsync-lambda.expected.json

-4
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@
114114
},
115115
"FieldName": "getPost",
116116
"TypeName": "Query",
117-
"CachingConfig": {},
118117
"DataSourceName": "LambdaDS",
119118
"Kind": "UNIT",
120119
"RequestMappingTemplate": "{\"version\": \"2017-02-28\", \"operation\": \"Invoke\", \"payload\": { \"field\": \"getPost\", \"arguments\": $utils.toJson($context.arguments)}}",
@@ -136,7 +135,6 @@
136135
},
137136
"FieldName": "allPosts",
138137
"TypeName": "Query",
139-
"CachingConfig": {},
140138
"DataSourceName": "LambdaDS",
141139
"Kind": "UNIT",
142140
"RequestMappingTemplate": "{\"version\": \"2017-02-28\", \"operation\": \"Invoke\", \"payload\": { \"field\": \"allPosts\"}}",
@@ -158,7 +156,6 @@
158156
},
159157
"FieldName": "addPost",
160158
"TypeName": "Mutation",
161-
"CachingConfig": {},
162159
"DataSourceName": "LambdaDS",
163160
"Kind": "UNIT",
164161
"RequestMappingTemplate": "{\"version\": \"2017-02-28\", \"operation\": \"Invoke\", \"payload\": { \"field\": \"addPost\", \"arguments\": $utils.toJson($context.arguments)}}",
@@ -180,7 +177,6 @@
180177
},
181178
"FieldName": "relatedPosts",
182179
"TypeName": "Post",
183-
"CachingConfig": {},
184180
"DataSourceName": "LambdaDS",
185181
"Kind": "UNIT",
186182
"RequestMappingTemplate": "{\"version\": \"2017-02-28\", \"operation\": \"BatchInvoke\", \"payload\": { \"field\": \"relatedPosts\", \"source\": $utils.toJson($context.source)}}",

‎packages/@aws-cdk/aws-appsync/test/integ.auth-apikey.expected.json

-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@
132132
},
133133
"FieldName": "getTests",
134134
"TypeName": "Query",
135-
"CachingConfig": {},
136135
"DataSourceName": "testDataSource",
137136
"Kind": "UNIT",
138137
"RequestMappingTemplate": "{\"version\" : \"2017-02-28\", \"operation\" : \"Scan\"}",
@@ -154,7 +153,6 @@
154153
},
155154
"FieldName": "addTest",
156155
"TypeName": "Mutation",
157-
"CachingConfig": {},
158156
"DataSourceName": "testDataSource",
159157
"Kind": "UNIT",
160158
"RequestMappingTemplate": "\n #set($input = $ctx.args.test)\n \n {\n \"version\": \"2017-02-28\",\n \"operation\": \"PutItem\",\n \"key\" : {\n \"id\" : $util.dynamodb.toDynamoDBJson($util.autoId())\n },\n \"attributeValues\": $util.dynamodb.toMapValuesJson($input)\n }",

‎packages/@aws-cdk/aws-appsync/test/integ.graphql-elasticsearch.expected.json

-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@
196196
},
197197
"FieldName": "getTests",
198198
"TypeName": "Query",
199-
"CachingConfig": {},
200199
"DataSourceName": "ds",
201200
"Kind": "UNIT",
202201
"RequestMappingTemplate": "{\"version\":\"2017-02-28\",\"operation\":\"GET\",\"path\":\"/id/post/_search\",\"params\":{\"headers\":{},\"queryString\":{},\"body\":{\"from\":0,\"size\":50}}}",

‎packages/@aws-cdk/aws-appsync/test/integ.graphql-iam.expected.json

-3
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@
163163
},
164164
"FieldName": "getTest",
165165
"TypeName": "Query",
166-
"CachingConfig": {},
167166
"DataSourceName": "testDataSource",
168167
"Kind": "UNIT",
169168
"RequestMappingTemplate": "{\"version\": \"2017-02-28\", \"operation\": \"GetItem\", \"key\": {\"id\": $util.dynamodb.toDynamoDBJson($ctx.args.id)}}",
@@ -185,7 +184,6 @@
185184
},
186185
"FieldName": "getTests",
187186
"TypeName": "Query",
188-
"CachingConfig": {},
189187
"DataSourceName": "testDataSource",
190188
"Kind": "UNIT",
191189
"RequestMappingTemplate": "{\"version\" : \"2017-02-28\", \"operation\" : \"Scan\"}",
@@ -207,7 +205,6 @@
207205
},
208206
"FieldName": "addTest",
209207
"TypeName": "Mutation",
210-
"CachingConfig": {},
211208
"DataSourceName": "testDataSource",
212209
"Kind": "UNIT",
213210
"RequestMappingTemplate": "\n #set($input = $ctx.args.test)\n \n {\n \"version\": \"2017-02-28\",\n \"operation\": \"PutItem\",\n \"key\" : {\n \"id\" : $util.dynamodb.toDynamoDBJson($util.autoId())\n },\n \"attributeValues\": $util.dynamodb.toMapValuesJson($input)\n }",

‎packages/@aws-cdk/aws-appsync/test/integ.graphql-schema.expected.json

-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@
131131
},
132132
"FieldName": "getPlanets",
133133
"TypeName": "Query",
134-
"CachingConfig": {},
135134
"DataSourceName": "planets",
136135
"Kind": "UNIT",
137136
"RequestMappingTemplate": "{\"version\" : \"2017-02-28\", \"operation\" : \"Scan\"}",
@@ -153,7 +152,6 @@
153152
},
154153
"FieldName": "addPlanet",
155154
"TypeName": "Mutation",
156-
"CachingConfig": {},
157155
"DataSourceName": "planets",
158156
"Kind": "UNIT",
159157
"RequestMappingTemplate": "\n #set($input = $context.arguments)\n $util.qr($input.put(\"name\", $context.arguments.name))\n$util.qr($input.put(\"diameter\", $context.arguments.diameter))\n$util.qr($input.put(\"rotationPeriod\", $context.arguments.rotationPeriod))\n$util.qr($input.put(\"orbitalPeriod\", $context.arguments.orbitalPeriod))\n$util.qr($input.put(\"gravityPeriod\", $context.arguments.gravity))\n$util.qr($input.put(\"population\", $context.arguments.population))\n$util.qr($input.put(\"climates\", $context.arguments.climates))\n$util.qr($input.put(\"terrains\", $context.arguments.terrains))\n$util.qr($input.put(\"surfaceWater\", $context.arguments.surfaceWater))\n {\n \"version\": \"2017-02-28\",\n \"operation\": \"PutItem\",\n \"key\" : {\n \"id\" : $util.dynamodb.toDynamoDBJson($util.autoId())\n },\n \"attributeValues\": $util.dynamodb.toMapValuesJson($input)\n }",

‎packages/@aws-cdk/aws-appsync/test/integ.graphql.expected.json

-24
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@
103103
},
104104
"FieldName": "getServiceVersion",
105105
"TypeName": "Query",
106-
"CachingConfig": {},
107106
"DataSourceName": "None",
108107
"Kind": "UNIT",
109108
"RequestMappingTemplate": "{\"version\":\"2017-02-28\"}",
@@ -212,7 +211,6 @@
212211
},
213212
"FieldName": "getCustomers",
214213
"TypeName": "Query",
215-
"CachingConfig": {},
216214
"DataSourceName": "Customer",
217215
"Kind": "UNIT",
218216
"RequestMappingTemplate": "{\"version\" : \"2017-02-28\", \"operation\" : \"Scan\"}",
@@ -234,7 +232,6 @@
234232
},
235233
"FieldName": "getCustomer",
236234
"TypeName": "Query",
237-
"CachingConfig": {},
238235
"DataSourceName": "Customer",
239236
"Kind": "UNIT",
240237
"RequestMappingTemplate": "{\"version\": \"2017-02-28\", \"operation\": \"GetItem\", \"key\": {\"id\": $util.dynamodb.toDynamoDBJson($ctx.args.id)}}",
@@ -256,7 +253,6 @@
256253
},
257254
"FieldName": "addCustomer",
258255
"TypeName": "Mutation",
259-
"CachingConfig": {},
260256
"DataSourceName": "Customer",
261257
"Kind": "UNIT",
262258
"RequestMappingTemplate": "\n #set($input = $ctx.args.customer)\n \n {\n \"version\": \"2017-02-28\",\n \"operation\": \"PutItem\",\n \"key\" : {\n \"id\" : $util.dynamodb.toDynamoDBJson($util.autoId())\n },\n \"attributeValues\": $util.dynamodb.toMapValuesJson($input)\n }",
@@ -278,7 +274,6 @@
278274
},
279275
"FieldName": "saveCustomer",
280276
"TypeName": "Mutation",
281-
"CachingConfig": {},
282277
"DataSourceName": "Customer",
283278
"Kind": "UNIT",
284279
"RequestMappingTemplate": "\n #set($input = $ctx.args.customer)\n \n {\n \"version\": \"2017-02-28\",\n \"operation\": \"PutItem\",\n \"key\" : {\n \"id\" : $util.dynamodb.toDynamoDBJson($ctx.args.id)\n },\n \"attributeValues\": $util.dynamodb.toMapValuesJson($input)\n }",
@@ -300,7 +295,6 @@
300295
},
301296
"FieldName": "saveCustomerWithFirstOrder",
302297
"TypeName": "Mutation",
303-
"CachingConfig": {},
304298
"DataSourceName": "Customer",
305299
"Kind": "UNIT",
306300
"RequestMappingTemplate": "\n #set($input = $ctx.args.order)\n $util.qr($input.put(\"referral\", referral))\n {\n \"version\": \"2017-02-28\",\n \"operation\": \"PutItem\",\n \"key\" : {\n \"order\" : $util.dynamodb.toDynamoDBJson($util.autoId()),\"customer\" : $util.dynamodb.toDynamoDBJson($ctx.args.customer.id)\n },\n \"attributeValues\": $util.dynamodb.toMapValuesJson($input)\n }",
@@ -322,7 +316,6 @@
322316
},
323317
"FieldName": "removeCustomer",
324318
"TypeName": "Mutation",
325-
"CachingConfig": {},
326319
"DataSourceName": "Customer",
327320
"Kind": "UNIT",
328321
"RequestMappingTemplate": "{\"version\": \"2017-02-28\", \"operation\": \"DeleteItem\", \"key\": {\"id\": $util.dynamodb.toDynamoDBJson($ctx.args.id)}}",
@@ -442,7 +435,6 @@
442435
},
443436
"FieldName": "getCustomerOrdersEq",
444437
"TypeName": "Query",
445-
"CachingConfig": {},
446438
"DataSourceName": "Order",
447439
"Kind": "UNIT",
448440
"RequestMappingTemplate": "{\"version\" : \"2017-02-28\", \"operation\" : \"Query\", \"query\" : {\n \"expression\" : \"#customer = :customer\",\n \"expressionNames\" : {\n \"#customer\" : \"customer\"\n },\n \"expressionValues\" : {\n \":customer\" : $util.dynamodb.toDynamoDBJson($ctx.args.customer)\n }\n }}",
@@ -464,7 +456,6 @@
464456
},
465457
"FieldName": "getOrderCustomersEq",
466458
"TypeName": "Query",
467-
"CachingConfig": {},
468459
"DataSourceName": "Order",
469460
"Kind": "UNIT",
470461
"RequestMappingTemplate": "{\"version\" : \"2017-02-28\", \"operation\" : \"Query\", \"index\" : \"orderIndex\", \"query\" : {\n \"expression\" : \"#order = :order\",\n \"expressionNames\" : {\n \"#order\" : \"order\"\n },\n \"expressionValues\" : {\n \":order\" : $util.dynamodb.toDynamoDBJson($ctx.args.order)\n }\n }}",
@@ -486,7 +477,6 @@
486477
},
487478
"FieldName": "getCustomerOrdersLt",
488479
"TypeName": "Query",
489-
"CachingConfig": {},
490480
"DataSourceName": "Order",
491481
"Kind": "UNIT",
492482
"RequestMappingTemplate": "{\"version\" : \"2017-02-28\", \"operation\" : \"Query\", \"query\" : {\n \"expression\" : \"#customer < :customer\",\n \"expressionNames\" : {\n \"#customer\" : \"customer\"\n },\n \"expressionValues\" : {\n \":customer\" : $util.dynamodb.toDynamoDBJson($ctx.args.customer)\n }\n }}",
@@ -508,7 +498,6 @@
508498
},
509499
"FieldName": "getOrderCustomersLt",
510500
"TypeName": "Query",
511-
"CachingConfig": {},
512501
"DataSourceName": "Order",
513502
"Kind": "UNIT",
514503
"RequestMappingTemplate": "{\"version\" : \"2017-02-28\", \"operation\" : \"Query\", \"index\" : \"orderIndex\", \"query\" : {\n \"expression\" : \"#order < :order\",\n \"expressionNames\" : {\n \"#order\" : \"order\"\n },\n \"expressionValues\" : {\n \":order\" : $util.dynamodb.toDynamoDBJson($ctx.args.order)\n }\n }}",
@@ -530,7 +519,6 @@
530519
},
531520
"FieldName": "getCustomerOrdersLe",
532521
"TypeName": "Query",
533-
"CachingConfig": {},
534522
"DataSourceName": "Order",
535523
"Kind": "UNIT",
536524
"RequestMappingTemplate": "{\"version\" : \"2017-02-28\", \"operation\" : \"Query\", \"query\" : {\n \"expression\" : \"#customer <= :customer\",\n \"expressionNames\" : {\n \"#customer\" : \"customer\"\n },\n \"expressionValues\" : {\n \":customer\" : $util.dynamodb.toDynamoDBJson($ctx.args.customer)\n }\n }}",
@@ -552,7 +540,6 @@
552540
},
553541
"FieldName": "getOrderCustomersLe",
554542
"TypeName": "Query",
555-
"CachingConfig": {},
556543
"DataSourceName": "Order",
557544
"Kind": "UNIT",
558545
"RequestMappingTemplate": "{\"version\" : \"2017-02-28\", \"operation\" : \"Query\", \"index\" : \"orderIndex\", \"query\" : {\n \"expression\" : \"#order <= :order\",\n \"expressionNames\" : {\n \"#order\" : \"order\"\n },\n \"expressionValues\" : {\n \":order\" : $util.dynamodb.toDynamoDBJson($ctx.args.order)\n }\n }}",
@@ -574,7 +561,6 @@
574561
},
575562
"FieldName": "getCustomerOrdersGt",
576563
"TypeName": "Query",
577-
"CachingConfig": {},
578564
"DataSourceName": "Order",
579565
"Kind": "UNIT",
580566
"RequestMappingTemplate": "{\"version\" : \"2017-02-28\", \"operation\" : \"Query\", \"query\" : {\n \"expression\" : \"#customer > :customer\",\n \"expressionNames\" : {\n \"#customer\" : \"customer\"\n },\n \"expressionValues\" : {\n \":customer\" : $util.dynamodb.toDynamoDBJson($ctx.args.customer)\n }\n }}",
@@ -596,7 +582,6 @@
596582
},
597583
"FieldName": "getOrderCustomersGt",
598584
"TypeName": "Query",
599-
"CachingConfig": {},
600585
"DataSourceName": "Order",
601586
"Kind": "UNIT",
602587
"RequestMappingTemplate": "{\"version\" : \"2017-02-28\", \"operation\" : \"Query\", \"index\" : \"orderIndex\", \"query\" : {\n \"expression\" : \"#order > :order\",\n \"expressionNames\" : {\n \"#order\" : \"order\"\n },\n \"expressionValues\" : {\n \":order\" : $util.dynamodb.toDynamoDBJson($ctx.args.order)\n }\n }}",
@@ -618,7 +603,6 @@
618603
},
619604
"FieldName": "getCustomerOrdersGe",
620605
"TypeName": "Query",
621-
"CachingConfig": {},
622606
"DataSourceName": "Order",
623607
"Kind": "UNIT",
624608
"RequestMappingTemplate": "{\"version\" : \"2017-02-28\", \"operation\" : \"Query\", \"query\" : {\n \"expression\" : \"#customer >= :customer\",\n \"expressionNames\" : {\n \"#customer\" : \"customer\"\n },\n \"expressionValues\" : {\n \":customer\" : $util.dynamodb.toDynamoDBJson($ctx.args.customer)\n }\n }}",
@@ -640,7 +624,6 @@
640624
},
641625
"FieldName": "getOrderCustomersGe",
642626
"TypeName": "Query",
643-
"CachingConfig": {},
644627
"DataSourceName": "Order",
645628
"Kind": "UNIT",
646629
"RequestMappingTemplate": "{\"version\" : \"2017-02-28\", \"operation\" : \"Query\", \"index\" : \"orderIndex\", \"query\" : {\n \"expression\" : \"#order >= :order\",\n \"expressionNames\" : {\n \"#order\" : \"order\"\n },\n \"expressionValues\" : {\n \":order\" : $util.dynamodb.toDynamoDBJson($ctx.args.order)\n }\n }}",
@@ -662,7 +645,6 @@
662645
},
663646
"FieldName": "getCustomerOrdersFilter",
664647
"TypeName": "Query",
665-
"CachingConfig": {},
666648
"DataSourceName": "Order",
667649
"Kind": "UNIT",
668650
"RequestMappingTemplate": "{\"version\" : \"2017-02-28\", \"operation\" : \"Query\", \"query\" : {\n \"expression\" : \"#customer = :customer AND begins_with(#order, :order)\",\n \"expressionNames\" : {\n \"#customer\" : \"customer\", \"#order\" : \"order\"\n },\n \"expressionValues\" : {\n \":customer\" : $util.dynamodb.toDynamoDBJson($ctx.args.customer), \":order\" : $util.dynamodb.toDynamoDBJson($ctx.args.order)\n }\n }}",
@@ -684,7 +666,6 @@
684666
},
685667
"FieldName": "getCustomerOrdersBetween",
686668
"TypeName": "Query",
687-
"CachingConfig": {},
688669
"DataSourceName": "Order",
689670
"Kind": "UNIT",
690671
"RequestMappingTemplate": "{\"version\" : \"2017-02-28\", \"operation\" : \"Query\", \"query\" : {\n \"expression\" : \"#customer = :customer AND #order BETWEEN :order1 AND :order2\",\n \"expressionNames\" : {\n \"#customer\" : \"customer\", \"#order\" : \"order\"\n },\n \"expressionValues\" : {\n \":customer\" : $util.dynamodb.toDynamoDBJson($ctx.args.customer), \":order1\" : $util.dynamodb.toDynamoDBJson($ctx.args.order1), \":order2\" : $util.dynamodb.toDynamoDBJson($ctx.args.order2)\n }\n }}",
@@ -706,7 +687,6 @@
706687
},
707688
"FieldName": "getOrderCustomersFilter",
708689
"TypeName": "Query",
709-
"CachingConfig": {},
710690
"DataSourceName": "Order",
711691
"Kind": "UNIT",
712692
"RequestMappingTemplate": "{\"version\" : \"2017-02-28\", \"operation\" : \"Query\", \"query\" : {\n \"expression\" : \"#order = :order AND begins_with(#customer, :customer)\",\n \"expressionNames\" : {\n \"#order\" : \"order\", \"#customer\" : \"customer\"\n },\n \"expressionValues\" : {\n \":order\" : $util.dynamodb.toDynamoDBJson($ctx.args.order), \":customer\" : $util.dynamodb.toDynamoDBJson($ctx.args.customer)\n }\n }}",
@@ -728,7 +708,6 @@
728708
},
729709
"FieldName": "getOrderCustomersBetween",
730710
"TypeName": "Query",
731-
"CachingConfig": {},
732711
"DataSourceName": "Order",
733712
"Kind": "UNIT",
734713
"RequestMappingTemplate": "{\"version\" : \"2017-02-28\", \"operation\" : \"Query\", \"index\" : \"orderIndex\", \"query\" : {\n \"expression\" : \"#order = :order AND #customer BETWEEN :customer1 AND :customer2\",\n \"expressionNames\" : {\n \"#order\" : \"order\", \"#customer\" : \"customer\"\n },\n \"expressionValues\" : {\n \":order\" : $util.dynamodb.toDynamoDBJson($ctx.args.order), \":customer1\" : $util.dynamodb.toDynamoDBJson($ctx.args.customer1), \":customer2\" : $util.dynamodb.toDynamoDBJson($ctx.args.customer2)\n }\n }}",
@@ -849,7 +828,6 @@
849828
},
850829
"FieldName": "getPayment",
851830
"TypeName": "Query",
852-
"CachingConfig": {},
853831
"DataSourceName": "Payment",
854832
"Kind": "UNIT",
855833
"RequestMappingTemplate": "{\"version\": \"2017-02-28\", \"operation\": \"GetItem\", \"key\": {\"id\": $util.dynamodb.toDynamoDBJson($ctx.args.id)}}",
@@ -871,7 +849,6 @@
871849
},
872850
"FieldName": "savePayment",
873851
"TypeName": "Mutation",
874-
"CachingConfig": {},
875852
"DataSourceName": "Payment",
876853
"Kind": "UNIT",
877854
"RequestMappingTemplate": "\n #set($input = $ctx.args.payment)\n \n {\n \"version\": \"2017-02-28\",\n \"operation\": \"PutItem\",\n \"key\" : {\n \"id\" : $util.dynamodb.toDynamoDBJson($util.autoId())\n },\n \"attributeValues\": $util.dynamodb.toMapValuesJson($input)\n }",
@@ -932,7 +909,6 @@
932909
},
933910
"FieldName": "doPostOnAws",
934911
"TypeName": "Mutation",
935-
"CachingConfig": {},
936912
"DataSourceName": "http",
937913
"Kind": "UNIT",
938914
"RequestMappingTemplate": "{\n \"version\": \"2018-05-29\",\n \"method\": \"POST\",\n # if full path is https://api.xxxxxxxxx.com/posts then resourcePath would be /posts\n \"resourcePath\": \"/path/123\",\n \"params\":{\n \"body\": $util.toJson($ctx.args),\n \"headers\":{\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"$ctx.request.headers.Authorization\"\n }\n }\n }",

0 commit comments

Comments
 (0)
Please sign in to comment.