@aws-amplify/graphql-model-transformer 1.5.0-rds.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API.md +15 -15
- package/CHANGELOG.md +2 -7
- package/lib/graphql-types/mutation.d.ts.map +1 -1
- package/lib/graphql-types/mutation.js +2 -9
- package/lib/graphql-types/mutation.js.map +1 -1
- package/lib/rds-lambda.zip +0 -0
- package/lib/rds-notification-lambda.zip +0 -0
- package/lib/rds-patching-lambda.zip +0 -0
- package/lib/resolvers/generators/dynamodb-vtl-generator.d.ts +5 -6
- package/lib/resolvers/generators/dynamodb-vtl-generator.d.ts.map +1 -1
- package/lib/resolvers/generators/dynamodb-vtl-generator.js +5 -5
- package/lib/resolvers/generators/dynamodb-vtl-generator.js.map +1 -1
- package/lib/resolvers/generators/rds-vtl-generator.d.ts +5 -6
- package/lib/resolvers/generators/rds-vtl-generator.d.ts.map +1 -1
- package/lib/resolvers/generators/rds-vtl-generator.js +10 -10
- package/lib/resolvers/generators/rds-vtl-generator.js.map +1 -1
- package/lib/resolvers/generators/vtl-generator.d.ts +5 -6
- package/lib/resolvers/generators/vtl-generator.d.ts.map +1 -1
- package/lib/resolvers/rds/mutation.d.ts +3 -4
- package/lib/resolvers/rds/mutation.d.ts.map +1 -1
- package/lib/resolvers/rds/mutation.js +3 -7
- package/lib/resolvers/rds/mutation.js.map +1 -1
- package/lib/resolvers/rds/query.d.ts +1 -2
- package/lib/resolvers/rds/query.d.ts.map +1 -1
- package/lib/resolvers/rds/query.js +1 -3
- package/lib/resolvers/rds/query.js.map +1 -1
- package/lib/resolvers/rds/resolver.d.ts +7 -11
- package/lib/resolvers/rds/resolver.d.ts.map +1 -1
- package/lib/resolvers/rds/resolver.js +39 -50
- package/lib/resolvers/rds/resolver.js.map +1 -1
- package/lib/resources/dynamo-model-resource-generator.d.ts +2 -2
- package/lib/resources/dynamo-model-resource-generator.d.ts.map +1 -1
- package/lib/resources/dynamo-model-resource-generator.js +48 -43
- package/lib/resources/dynamo-model-resource-generator.js.map +1 -1
- package/lib/resources/model-resource-generator.js +8 -8
- package/lib/resources/model-resource-generator.js.map +1 -1
- package/lib/resources/rds-model-resource-generator.js +13 -13
- package/package.json +6 -5
- package/publish-notification-lambda/node_modules/.package-lock.json +3 -3
- package/publish-notification-lambda/node_modules/@types/node/README.md +1 -1
- package/publish-notification-lambda/node_modules/@types/node/package.json +2 -2
- package/publish-notification-lambda/package-lock.json +3 -3
- package/rds-lambda/handler.ts +1 -2
- package/rds-lambda/node_modules/.package-lock.json +6 -6
- package/rds-lambda/node_modules/@types/node/README.md +1 -1
- package/rds-lambda/node_modules/@types/node/package.json +2 -2
- package/rds-lambda/node_modules/electron-to-chromium/full-chromium-versions.json +1 -1
- package/rds-lambda/node_modules/electron-to-chromium/full-versions.json +1 -1
- package/rds-lambda/node_modules/electron-to-chromium/package.json +1 -1
- package/rds-lambda/package-lock.json +6 -6
- package/rds-patching-lambda/node_modules/.package-lock.json +3 -3
- package/rds-patching-lambda/node_modules/@types/node/README.md +1 -1
- package/rds-patching-lambda/node_modules/@types/node/package.json +2 -2
- package/rds-patching-lambda/package-lock.json +3 -3
- package/src/__tests__/__snapshots__/model-transformer.test.ts.snap +0 -688
- package/src/__tests__/model-directive-arguments.test.ts +23 -28
- package/src/__tests__/model-transformer.test.ts +137 -216
- package/src/graphql-types/mutation.ts +3 -11
- package/src/resolvers/generators/dynamodb-vtl-generator.ts +5 -7
- package/src/resolvers/generators/rds-vtl-generator.ts +10 -12
- package/src/resolvers/generators/vtl-generator.ts +5 -6
- package/src/resolvers/rds/mutation.ts +3 -18
- package/src/resolvers/rds/query.ts +1 -9
- package/src/resolvers/rds/resolver.ts +45 -62
- package/src/resources/dynamo-model-resource-generator.ts +50 -47
- package/src/resources/model-resource-generator.ts +8 -8
- package/src/resources/rds-model-resource-generator.ts +13 -13
- package/tsconfig.tsbuildinfo +1 -1
@@ -1,224 +1,5 @@
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
2
|
|
3
|
-
exports[`ModelTransformer: id with non string type should require the field on create mutation 1`] = `
|
4
|
-
"type Task {
|
5
|
-
id: Int!
|
6
|
-
title: String!
|
7
|
-
createdAt: AWSDateTime!
|
8
|
-
updatedAt: AWSDateTime!
|
9
|
-
}
|
10
|
-
|
11
|
-
input ModelStringInput {
|
12
|
-
ne: String
|
13
|
-
eq: String
|
14
|
-
le: String
|
15
|
-
lt: String
|
16
|
-
ge: String
|
17
|
-
gt: String
|
18
|
-
contains: String
|
19
|
-
notContains: String
|
20
|
-
between: [String]
|
21
|
-
beginsWith: String
|
22
|
-
attributeExists: Boolean
|
23
|
-
attributeType: ModelAttributeTypes
|
24
|
-
size: ModelSizeInput
|
25
|
-
}
|
26
|
-
|
27
|
-
input ModelIntInput {
|
28
|
-
ne: Int
|
29
|
-
eq: Int
|
30
|
-
le: Int
|
31
|
-
lt: Int
|
32
|
-
ge: Int
|
33
|
-
gt: Int
|
34
|
-
between: [Int]
|
35
|
-
attributeExists: Boolean
|
36
|
-
attributeType: ModelAttributeTypes
|
37
|
-
}
|
38
|
-
|
39
|
-
input ModelFloatInput {
|
40
|
-
ne: Float
|
41
|
-
eq: Float
|
42
|
-
le: Float
|
43
|
-
lt: Float
|
44
|
-
ge: Float
|
45
|
-
gt: Float
|
46
|
-
between: [Float]
|
47
|
-
attributeExists: Boolean
|
48
|
-
attributeType: ModelAttributeTypes
|
49
|
-
}
|
50
|
-
|
51
|
-
input ModelBooleanInput {
|
52
|
-
ne: Boolean
|
53
|
-
eq: Boolean
|
54
|
-
attributeExists: Boolean
|
55
|
-
attributeType: ModelAttributeTypes
|
56
|
-
}
|
57
|
-
|
58
|
-
input ModelIDInput {
|
59
|
-
ne: ID
|
60
|
-
eq: ID
|
61
|
-
le: ID
|
62
|
-
lt: ID
|
63
|
-
ge: ID
|
64
|
-
gt: ID
|
65
|
-
contains: ID
|
66
|
-
notContains: ID
|
67
|
-
between: [ID]
|
68
|
-
beginsWith: ID
|
69
|
-
attributeExists: Boolean
|
70
|
-
attributeType: ModelAttributeTypes
|
71
|
-
size: ModelSizeInput
|
72
|
-
}
|
73
|
-
|
74
|
-
input ModelSubscriptionStringInput {
|
75
|
-
ne: String
|
76
|
-
eq: String
|
77
|
-
le: String
|
78
|
-
lt: String
|
79
|
-
ge: String
|
80
|
-
gt: String
|
81
|
-
contains: String
|
82
|
-
notContains: String
|
83
|
-
between: [String]
|
84
|
-
beginsWith: String
|
85
|
-
in: [String]
|
86
|
-
notIn: [String]
|
87
|
-
}
|
88
|
-
|
89
|
-
input ModelSubscriptionIntInput {
|
90
|
-
ne: Int
|
91
|
-
eq: Int
|
92
|
-
le: Int
|
93
|
-
lt: Int
|
94
|
-
ge: Int
|
95
|
-
gt: Int
|
96
|
-
between: [Int]
|
97
|
-
in: [Int]
|
98
|
-
notIn: [Int]
|
99
|
-
}
|
100
|
-
|
101
|
-
input ModelSubscriptionFloatInput {
|
102
|
-
ne: Float
|
103
|
-
eq: Float
|
104
|
-
le: Float
|
105
|
-
lt: Float
|
106
|
-
ge: Float
|
107
|
-
gt: Float
|
108
|
-
between: [Float]
|
109
|
-
in: [Float]
|
110
|
-
notIn: [Float]
|
111
|
-
}
|
112
|
-
|
113
|
-
input ModelSubscriptionBooleanInput {
|
114
|
-
ne: Boolean
|
115
|
-
eq: Boolean
|
116
|
-
}
|
117
|
-
|
118
|
-
input ModelSubscriptionIDInput {
|
119
|
-
ne: ID
|
120
|
-
eq: ID
|
121
|
-
le: ID
|
122
|
-
lt: ID
|
123
|
-
ge: ID
|
124
|
-
gt: ID
|
125
|
-
contains: ID
|
126
|
-
notContains: ID
|
127
|
-
between: [ID]
|
128
|
-
beginsWith: ID
|
129
|
-
in: [ID]
|
130
|
-
notIn: [ID]
|
131
|
-
}
|
132
|
-
|
133
|
-
enum ModelAttributeTypes {
|
134
|
-
binary
|
135
|
-
binarySet
|
136
|
-
bool
|
137
|
-
list
|
138
|
-
map
|
139
|
-
number
|
140
|
-
numberSet
|
141
|
-
string
|
142
|
-
stringSet
|
143
|
-
_null
|
144
|
-
}
|
145
|
-
|
146
|
-
input ModelSizeInput {
|
147
|
-
ne: Int
|
148
|
-
eq: Int
|
149
|
-
le: Int
|
150
|
-
lt: Int
|
151
|
-
ge: Int
|
152
|
-
gt: Int
|
153
|
-
between: [Int]
|
154
|
-
}
|
155
|
-
|
156
|
-
enum ModelSortDirection {
|
157
|
-
ASC
|
158
|
-
DESC
|
159
|
-
}
|
160
|
-
|
161
|
-
type ModelTaskConnection {
|
162
|
-
items: [Task]!
|
163
|
-
nextToken: String
|
164
|
-
}
|
165
|
-
|
166
|
-
input ModelTaskFilterInput {
|
167
|
-
id: ModelIntInput
|
168
|
-
title: ModelStringInput
|
169
|
-
and: [ModelTaskFilterInput]
|
170
|
-
or: [ModelTaskFilterInput]
|
171
|
-
not: ModelTaskFilterInput
|
172
|
-
}
|
173
|
-
|
174
|
-
type Query {
|
175
|
-
getTask(id: ID!): Task
|
176
|
-
listTasks(filter: ModelTaskFilterInput, limit: Int, nextToken: String): ModelTaskConnection
|
177
|
-
}
|
178
|
-
|
179
|
-
input ModelTaskConditionInput {
|
180
|
-
id: ModelIntInput
|
181
|
-
title: ModelStringInput
|
182
|
-
and: [ModelTaskConditionInput]
|
183
|
-
or: [ModelTaskConditionInput]
|
184
|
-
not: ModelTaskConditionInput
|
185
|
-
}
|
186
|
-
|
187
|
-
input CreateTaskInput {
|
188
|
-
id: Int!
|
189
|
-
title: String!
|
190
|
-
}
|
191
|
-
|
192
|
-
input UpdateTaskInput {
|
193
|
-
id: Int!
|
194
|
-
title: String
|
195
|
-
}
|
196
|
-
|
197
|
-
input DeleteTaskInput {
|
198
|
-
id: ID!
|
199
|
-
}
|
200
|
-
|
201
|
-
type Mutation {
|
202
|
-
createTask(input: CreateTaskInput!, condition: ModelTaskConditionInput): Task
|
203
|
-
updateTask(input: UpdateTaskInput!, condition: ModelTaskConditionInput): Task
|
204
|
-
deleteTask(input: DeleteTaskInput!, condition: ModelTaskConditionInput): Task
|
205
|
-
}
|
206
|
-
|
207
|
-
input ModelSubscriptionTaskFilterInput {
|
208
|
-
id: ModelSubscriptionIntInput
|
209
|
-
title: ModelSubscriptionStringInput
|
210
|
-
and: [ModelSubscriptionTaskFilterInput]
|
211
|
-
or: [ModelSubscriptionTaskFilterInput]
|
212
|
-
}
|
213
|
-
|
214
|
-
type Subscription {
|
215
|
-
onCreateTask(filter: ModelSubscriptionTaskFilterInput): Task @aws_subscribe(mutations: [\\"createTask\\"])
|
216
|
-
onUpdateTask(filter: ModelSubscriptionTaskFilterInput): Task @aws_subscribe(mutations: [\\"updateTask\\"])
|
217
|
-
onDeleteTask(filter: ModelSubscriptionTaskFilterInput): Task @aws_subscribe(mutations: [\\"deleteTask\\"])
|
218
|
-
}
|
219
|
-
"
|
220
|
-
`;
|
221
|
-
|
222
3
|
exports[`ModelTransformer: should filter known input types from create and update input fields 1`] = `
|
223
4
|
"type Test {
|
224
5
|
id: ID!
|
@@ -4337,475 +4118,6 @@ $util.toJson($UpdateItem)
|
|
4337
4118
|
## [End] Mutation Update resolver. **"
|
4338
4119
|
`;
|
4339
4120
|
|
4340
|
-
exports[`ModelTransformer: should successfully transform rds schema with array and object fields 1`] = `
|
4341
|
-
"type Note {
|
4342
|
-
id: ID!
|
4343
|
-
content: String!
|
4344
|
-
tags: [String!]
|
4345
|
-
attachments: Attachment
|
4346
|
-
}
|
4347
|
-
|
4348
|
-
type Attachment {
|
4349
|
-
report: String!
|
4350
|
-
image: String!
|
4351
|
-
}
|
4352
|
-
|
4353
|
-
input ModelStringInput {
|
4354
|
-
ne: String
|
4355
|
-
eq: String
|
4356
|
-
le: String
|
4357
|
-
lt: String
|
4358
|
-
ge: String
|
4359
|
-
gt: String
|
4360
|
-
contains: String
|
4361
|
-
notContains: String
|
4362
|
-
between: [String]
|
4363
|
-
beginsWith: String
|
4364
|
-
attributeExists: Boolean
|
4365
|
-
attributeType: ModelAttributeTypes
|
4366
|
-
size: ModelSizeInput
|
4367
|
-
}
|
4368
|
-
|
4369
|
-
input ModelIntInput {
|
4370
|
-
ne: Int
|
4371
|
-
eq: Int
|
4372
|
-
le: Int
|
4373
|
-
lt: Int
|
4374
|
-
ge: Int
|
4375
|
-
gt: Int
|
4376
|
-
between: [Int]
|
4377
|
-
attributeExists: Boolean
|
4378
|
-
attributeType: ModelAttributeTypes
|
4379
|
-
}
|
4380
|
-
|
4381
|
-
input ModelFloatInput {
|
4382
|
-
ne: Float
|
4383
|
-
eq: Float
|
4384
|
-
le: Float
|
4385
|
-
lt: Float
|
4386
|
-
ge: Float
|
4387
|
-
gt: Float
|
4388
|
-
between: [Float]
|
4389
|
-
attributeExists: Boolean
|
4390
|
-
attributeType: ModelAttributeTypes
|
4391
|
-
}
|
4392
|
-
|
4393
|
-
input ModelBooleanInput {
|
4394
|
-
ne: Boolean
|
4395
|
-
eq: Boolean
|
4396
|
-
attributeExists: Boolean
|
4397
|
-
attributeType: ModelAttributeTypes
|
4398
|
-
}
|
4399
|
-
|
4400
|
-
input ModelIDInput {
|
4401
|
-
ne: ID
|
4402
|
-
eq: ID
|
4403
|
-
le: ID
|
4404
|
-
lt: ID
|
4405
|
-
ge: ID
|
4406
|
-
gt: ID
|
4407
|
-
contains: ID
|
4408
|
-
notContains: ID
|
4409
|
-
between: [ID]
|
4410
|
-
beginsWith: ID
|
4411
|
-
attributeExists: Boolean
|
4412
|
-
attributeType: ModelAttributeTypes
|
4413
|
-
size: ModelSizeInput
|
4414
|
-
}
|
4415
|
-
|
4416
|
-
input ModelSubscriptionStringInput {
|
4417
|
-
ne: String
|
4418
|
-
eq: String
|
4419
|
-
le: String
|
4420
|
-
lt: String
|
4421
|
-
ge: String
|
4422
|
-
gt: String
|
4423
|
-
contains: String
|
4424
|
-
notContains: String
|
4425
|
-
between: [String]
|
4426
|
-
beginsWith: String
|
4427
|
-
in: [String]
|
4428
|
-
notIn: [String]
|
4429
|
-
}
|
4430
|
-
|
4431
|
-
input ModelSubscriptionIntInput {
|
4432
|
-
ne: Int
|
4433
|
-
eq: Int
|
4434
|
-
le: Int
|
4435
|
-
lt: Int
|
4436
|
-
ge: Int
|
4437
|
-
gt: Int
|
4438
|
-
between: [Int]
|
4439
|
-
in: [Int]
|
4440
|
-
notIn: [Int]
|
4441
|
-
}
|
4442
|
-
|
4443
|
-
input ModelSubscriptionFloatInput {
|
4444
|
-
ne: Float
|
4445
|
-
eq: Float
|
4446
|
-
le: Float
|
4447
|
-
lt: Float
|
4448
|
-
ge: Float
|
4449
|
-
gt: Float
|
4450
|
-
between: [Float]
|
4451
|
-
in: [Float]
|
4452
|
-
notIn: [Float]
|
4453
|
-
}
|
4454
|
-
|
4455
|
-
input ModelSubscriptionBooleanInput {
|
4456
|
-
ne: Boolean
|
4457
|
-
eq: Boolean
|
4458
|
-
}
|
4459
|
-
|
4460
|
-
input ModelSubscriptionIDInput {
|
4461
|
-
ne: ID
|
4462
|
-
eq: ID
|
4463
|
-
le: ID
|
4464
|
-
lt: ID
|
4465
|
-
ge: ID
|
4466
|
-
gt: ID
|
4467
|
-
contains: ID
|
4468
|
-
notContains: ID
|
4469
|
-
between: [ID]
|
4470
|
-
beginsWith: ID
|
4471
|
-
in: [ID]
|
4472
|
-
notIn: [ID]
|
4473
|
-
}
|
4474
|
-
|
4475
|
-
enum ModelAttributeTypes {
|
4476
|
-
binary
|
4477
|
-
binarySet
|
4478
|
-
bool
|
4479
|
-
list
|
4480
|
-
map
|
4481
|
-
number
|
4482
|
-
numberSet
|
4483
|
-
string
|
4484
|
-
stringSet
|
4485
|
-
_null
|
4486
|
-
}
|
4487
|
-
|
4488
|
-
input ModelSizeInput {
|
4489
|
-
ne: Int
|
4490
|
-
eq: Int
|
4491
|
-
le: Int
|
4492
|
-
lt: Int
|
4493
|
-
ge: Int
|
4494
|
-
gt: Int
|
4495
|
-
between: [Int]
|
4496
|
-
}
|
4497
|
-
|
4498
|
-
enum ModelSortDirection {
|
4499
|
-
ASC
|
4500
|
-
DESC
|
4501
|
-
}
|
4502
|
-
|
4503
|
-
input AttachmentInput {
|
4504
|
-
report: String!
|
4505
|
-
image: String!
|
4506
|
-
}
|
4507
|
-
|
4508
|
-
type ModelNoteConnection {
|
4509
|
-
items: [Note]!
|
4510
|
-
nextToken: String
|
4511
|
-
}
|
4512
|
-
|
4513
|
-
input ModelNoteFilterInput {
|
4514
|
-
id: ModelIDInput
|
4515
|
-
content: ModelStringInput
|
4516
|
-
tags: ModelStringInput
|
4517
|
-
and: [ModelNoteFilterInput]
|
4518
|
-
or: [ModelNoteFilterInput]
|
4519
|
-
not: ModelNoteFilterInput
|
4520
|
-
}
|
4521
|
-
|
4522
|
-
type Query {
|
4523
|
-
getNote(id: ID!): Note
|
4524
|
-
listNotes(filter: ModelNoteFilterInput, limit: Int, nextToken: String): ModelNoteConnection
|
4525
|
-
}
|
4526
|
-
|
4527
|
-
input ModelNoteConditionInput {
|
4528
|
-
content: ModelStringInput
|
4529
|
-
tags: ModelStringInput
|
4530
|
-
and: [ModelNoteConditionInput]
|
4531
|
-
or: [ModelNoteConditionInput]
|
4532
|
-
not: ModelNoteConditionInput
|
4533
|
-
}
|
4534
|
-
|
4535
|
-
input CreateNoteInput {
|
4536
|
-
id: ID
|
4537
|
-
content: String!
|
4538
|
-
tags: [String!]
|
4539
|
-
attachments: AttachmentInput
|
4540
|
-
}
|
4541
|
-
|
4542
|
-
input UpdateNoteInput {
|
4543
|
-
id: ID!
|
4544
|
-
content: String
|
4545
|
-
tags: [String!]
|
4546
|
-
attachments: AttachmentInput
|
4547
|
-
}
|
4548
|
-
|
4549
|
-
input DeleteNoteInput {
|
4550
|
-
id: ID!
|
4551
|
-
}
|
4552
|
-
|
4553
|
-
type Mutation {
|
4554
|
-
createNote(input: CreateNoteInput!, condition: ModelNoteConditionInput): Note
|
4555
|
-
updateNote(input: UpdateNoteInput!, condition: ModelNoteConditionInput): Note
|
4556
|
-
deleteNote(input: DeleteNoteInput!, condition: ModelNoteConditionInput): Note
|
4557
|
-
}
|
4558
|
-
|
4559
|
-
input ModelSubscriptionNoteFilterInput {
|
4560
|
-
id: ModelSubscriptionIDInput
|
4561
|
-
content: ModelSubscriptionStringInput
|
4562
|
-
tags: ModelSubscriptionStringInput
|
4563
|
-
and: [ModelSubscriptionNoteFilterInput]
|
4564
|
-
or: [ModelSubscriptionNoteFilterInput]
|
4565
|
-
}
|
4566
|
-
|
4567
|
-
type Subscription {
|
4568
|
-
onCreateNote(filter: ModelSubscriptionNoteFilterInput): Note @aws_subscribe(mutations: [\\"createNote\\"])
|
4569
|
-
onUpdateNote(filter: ModelSubscriptionNoteFilterInput): Note @aws_subscribe(mutations: [\\"updateNote\\"])
|
4570
|
-
onDeleteNote(filter: ModelSubscriptionNoteFilterInput): Note @aws_subscribe(mutations: [\\"deleteNote\\"])
|
4571
|
-
}
|
4572
|
-
"
|
4573
|
-
`;
|
4574
|
-
|
4575
|
-
exports[`ModelTransformer: should successfully transform rds schema with array and object fields 2`] = `
|
4576
|
-
Object {
|
4577
|
-
"Mutation.createNote.init.1.req.vtl": "## [Start] Initialization default values. **
|
4578
|
-
$util.qr($ctx.stash.put(\\"defaultValues\\", $util.defaultIfNull($ctx.stash.defaultValues, {})))
|
4579
|
-
#set( $createdAt = $util.time.nowISO8601() )
|
4580
|
-
$util.qr($ctx.stash.defaultValues.put(\\"id\\", $util.autoId()))
|
4581
|
-
$util.toJson({
|
4582
|
-
\\"version\\": \\"2018-05-29\\",
|
4583
|
-
\\"payload\\": {}
|
4584
|
-
})
|
4585
|
-
## [End] Initialization default values. **",
|
4586
|
-
"Mutation.createNote.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. **
|
4587
|
-
#if( !$ctx.stash.get(\\"hasAuth\\") )
|
4588
|
-
$util.unauthorized()
|
4589
|
-
#end
|
4590
|
-
$util.toJson({})
|
4591
|
-
## [End] Sandbox Mode Disabled. **",
|
4592
|
-
"Mutation.createNote.req.vtl": "## [Start] Invoke RDS Lambda data source. **
|
4593
|
-
#set( $lambdaInput = {} )
|
4594
|
-
#set( $lambdaInput.table = \\"Note\\" )
|
4595
|
-
#set( $lambdaInput.args = {} )
|
4596
|
-
#set( $lambdaInput.operation = \\"CREATE\\" )
|
4597
|
-
#set( $lambdaInput.operationName = \\"createNote\\" )
|
4598
|
-
#set( $lambdaInput.args.metadata = {} )
|
4599
|
-
#set( $lambdaInput.args.metadata.keys = [] )
|
4600
|
-
#set( $lambdaInput.args.metadata.nonScalarFields = [\\"tags\\", \\"attachments\\"] )
|
4601
|
-
$util.qr($lambdaInput.args.metadata.keys.addAll($util.defaultIfNull($ctx.stash.keys, [])))
|
4602
|
-
## Set the default values to put request **
|
4603
|
-
#set( $lambdaInput.args.input = $util.defaultIfNull($ctx.stash.defaultValues, {}) )
|
4604
|
-
## copy the values from input **
|
4605
|
-
$util.qr($lambdaInput.args.input.putAll($util.defaultIfNull($context.arguments.input, {})))
|
4606
|
-
{
|
4607
|
-
\\"version\\": \\"2018-05-29\\",
|
4608
|
-
\\"operation\\": \\"Invoke\\",
|
4609
|
-
\\"payload\\": $util.toJson($lambdaInput)
|
4610
|
-
}
|
4611
|
-
## [End] Invoke RDS Lambda data source. **",
|
4612
|
-
"Mutation.createNote.res.vtl": "## [Start] ResponseTemplate. **
|
4613
|
-
#if( $ctx.error )
|
4614
|
-
$util.error($ctx.error.message, $ctx.error.type)
|
4615
|
-
#else
|
4616
|
-
$util.toJson($ctx.result)
|
4617
|
-
#end
|
4618
|
-
## [End] ResponseTemplate. **",
|
4619
|
-
"Mutation.deleteNote.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. **
|
4620
|
-
#if( !$ctx.stash.get(\\"hasAuth\\") )
|
4621
|
-
$util.unauthorized()
|
4622
|
-
#end
|
4623
|
-
$util.toJson({})
|
4624
|
-
## [End] Sandbox Mode Disabled. **",
|
4625
|
-
"Mutation.deleteNote.req.vtl": "## [Start] Invoke RDS Lambda data source. **
|
4626
|
-
#set( $lambdaInput = {} )
|
4627
|
-
#set( $lambdaInput.table = \\"Note\\" )
|
4628
|
-
#set( $lambdaInput.args = $context.arguments )
|
4629
|
-
#set( $lambdaInput.operation = \\"DELETE\\" )
|
4630
|
-
#set( $lambdaInput.operationName = \\"deleteNote\\" )
|
4631
|
-
#set( $lambdaInput.args.metadata = {} )
|
4632
|
-
#set( $lambdaInput.args.metadata.keys = [] )
|
4633
|
-
#set( $lambdaInput.args.metadata.nonScalarFields = [\\"tags\\", \\"attachments\\"] )
|
4634
|
-
$util.qr($lambdaInput.args.metadata.keys.addAll($util.defaultIfNull($ctx.stash.keys, [])))
|
4635
|
-
#set( $lambdaInput.args.condition = $util.defaultIfNull($context.arguments.condition, {}) )
|
4636
|
-
{
|
4637
|
-
\\"version\\": \\"2018-05-29\\",
|
4638
|
-
\\"operation\\": \\"Invoke\\",
|
4639
|
-
\\"payload\\": $util.toJson($lambdaInput)
|
4640
|
-
}
|
4641
|
-
## [End] Invoke RDS Lambda data source. **",
|
4642
|
-
"Mutation.deleteNote.res.vtl": "## [Start] ResponseTemplate. **
|
4643
|
-
#if( $ctx.error )
|
4644
|
-
$util.error($ctx.error.message, $ctx.error.type)
|
4645
|
-
#else
|
4646
|
-
$util.toJson($ctx.result)
|
4647
|
-
#end
|
4648
|
-
## [End] ResponseTemplate. **",
|
4649
|
-
"Mutation.updateNote.init.1.req.vtl": "## [Start] Initialization default values. **
|
4650
|
-
$util.qr($ctx.stash.put(\\"defaultValues\\", $util.defaultIfNull($ctx.stash.defaultValues, {})))
|
4651
|
-
$util.toJson({
|
4652
|
-
\\"version\\": \\"2018-05-29\\",
|
4653
|
-
\\"payload\\": {}
|
4654
|
-
})
|
4655
|
-
## [End] Initialization default values. **",
|
4656
|
-
"Mutation.updateNote.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. **
|
4657
|
-
#if( !$ctx.stash.get(\\"hasAuth\\") )
|
4658
|
-
$util.unauthorized()
|
4659
|
-
#end
|
4660
|
-
$util.toJson({})
|
4661
|
-
## [End] Sandbox Mode Disabled. **",
|
4662
|
-
"Mutation.updateNote.req.vtl": "## [Start] Invoke RDS Lambda data source. **
|
4663
|
-
#set( $lambdaInput = {} )
|
4664
|
-
#set( $lambdaInput.table = \\"Note\\" )
|
4665
|
-
#set( $lambdaInput.args = {} )
|
4666
|
-
#set( $lambdaInput.operation = \\"UPDATE\\" )
|
4667
|
-
#set( $lambdaInput.operationName = \\"updateNote\\" )
|
4668
|
-
#set( $lambdaInput.args.metadata = {} )
|
4669
|
-
#set( $lambdaInput.args.metadata.keys = [] )
|
4670
|
-
#set( $lambdaInput.args.metadata.nonScalarFields = [\\"tags\\", \\"attachments\\"] )
|
4671
|
-
$util.qr($lambdaInput.args.metadata.keys.addAll($util.defaultIfNull($ctx.stash.keys, [])))
|
4672
|
-
## Set the default values to put request **
|
4673
|
-
#set( $lambdaInput.args.input = $util.defaultIfNull($ctx.stash.defaultValues, {}) )
|
4674
|
-
## copy the values from input **
|
4675
|
-
$util.qr($lambdaInput.args.input.putAll($util.defaultIfNull($context.arguments.input, {})))
|
4676
|
-
#set( $lambdaInput.args.condition = $util.defaultIfNull($context.arguments.condition, {}) )
|
4677
|
-
{
|
4678
|
-
\\"version\\": \\"2018-05-29\\",
|
4679
|
-
\\"operation\\": \\"Invoke\\",
|
4680
|
-
\\"payload\\": $util.toJson($lambdaInput)
|
4681
|
-
}
|
4682
|
-
## [End] Invoke RDS Lambda data source. **",
|
4683
|
-
"Mutation.updateNote.res.vtl": "## [Start] ResponseTemplate. **
|
4684
|
-
#if( $ctx.error )
|
4685
|
-
$util.error($ctx.error.message, $ctx.error.type)
|
4686
|
-
#else
|
4687
|
-
$util.toJson($ctx.result)
|
4688
|
-
#end
|
4689
|
-
## [End] ResponseTemplate. **",
|
4690
|
-
"Query.getNote.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. **
|
4691
|
-
#if( !$ctx.stash.get(\\"hasAuth\\") )
|
4692
|
-
$util.unauthorized()
|
4693
|
-
#end
|
4694
|
-
$util.toJson({})
|
4695
|
-
## [End] Sandbox Mode Disabled. **",
|
4696
|
-
"Query.getNote.req.vtl": "## [Start] Invoke RDS Lambda data source. **
|
4697
|
-
#set( $lambdaInput = {} )
|
4698
|
-
#set( $lambdaInput.args = {} )
|
4699
|
-
#set( $lambdaInput.table = \\"Note\\" )
|
4700
|
-
#set( $lambdaInput.operation = \\"GET\\" )
|
4701
|
-
#set( $lambdaInput.operationName = \\"getNote\\" )
|
4702
|
-
#set( $lambdaInput.args.metadata = {} )
|
4703
|
-
#set( $lambdaInput.args.metadata.keys = [] )
|
4704
|
-
#set( $lambdaInput.args.metadata.nonScalarFields = [\\"tags\\", \\"attachments\\"] )
|
4705
|
-
$util.qr($lambdaInput.args.metadata.keys.addAll($util.defaultIfNull($ctx.stash.keys, [])))
|
4706
|
-
#set( $lambdaInput.args.input = $util.defaultIfNull($ctx.stash.defaultValues, {}) )
|
4707
|
-
$util.qr($lambdaInput.args.input.putAll($util.defaultIfNull($context.arguments, {})))
|
4708
|
-
{
|
4709
|
-
\\"version\\": \\"2018-05-29\\",
|
4710
|
-
\\"operation\\": \\"Invoke\\",
|
4711
|
-
\\"payload\\": $util.toJson($lambdaInput)
|
4712
|
-
}
|
4713
|
-
## [End] Invoke RDS Lambda data source. **",
|
4714
|
-
"Query.getNote.res.vtl": "## [Start] ResponseTemplate. **
|
4715
|
-
#if( $ctx.error )
|
4716
|
-
$util.error($ctx.error.message, $ctx.error.type)
|
4717
|
-
#else
|
4718
|
-
$util.toJson($ctx.result)
|
4719
|
-
#end
|
4720
|
-
## [End] ResponseTemplate. **",
|
4721
|
-
"Query.listNotes.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. **
|
4722
|
-
#if( !$ctx.stash.get(\\"hasAuth\\") )
|
4723
|
-
$util.unauthorized()
|
4724
|
-
#end
|
4725
|
-
$util.toJson({})
|
4726
|
-
## [End] Sandbox Mode Disabled. **",
|
4727
|
-
"Query.listNotes.req.vtl": "## [Start] Invoke RDS Lambda data source. **
|
4728
|
-
#set( $lambdaInput = {} )
|
4729
|
-
#set( $lambdaInput.args = {} )
|
4730
|
-
#set( $lambdaInput.table = \\"Note\\" )
|
4731
|
-
#set( $lambdaInput.operation = \\"LIST\\" )
|
4732
|
-
#set( $lambdaInput.operationName = \\"listNotes\\" )
|
4733
|
-
#set( $lambdaInput.args.metadata = {} )
|
4734
|
-
#set( $lambdaInput.args.metadata.keys = [] )
|
4735
|
-
#set( $lambdaInput.args.metadata.nonScalarFields = [\\"tags\\", \\"attachments\\"] )
|
4736
|
-
$util.qr($lambdaInput.args.metadata.keys.addAll($util.defaultIfNull($ctx.stash.keys, [])))
|
4737
|
-
#set( $lambdaInput.args.input = $util.defaultIfNull($ctx.stash.defaultValues, {}) )
|
4738
|
-
$util.qr($lambdaInput.args.putAll($util.defaultIfNull($context.arguments, {})))
|
4739
|
-
{
|
4740
|
-
\\"version\\": \\"2018-05-29\\",
|
4741
|
-
\\"operation\\": \\"Invoke\\",
|
4742
|
-
\\"payload\\": $util.toJson($lambdaInput)
|
4743
|
-
}
|
4744
|
-
## [End] Invoke RDS Lambda data source. **",
|
4745
|
-
"Query.listNotes.res.vtl": "## [Start] ResponseTemplate. **
|
4746
|
-
#if( $ctx.error )
|
4747
|
-
$util.error($ctx.error.message, $ctx.error.type)
|
4748
|
-
#else
|
4749
|
-
$util.toJson($ctx.result)
|
4750
|
-
#end
|
4751
|
-
## [End] ResponseTemplate. **",
|
4752
|
-
"Subscription.onCreateNote.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. **
|
4753
|
-
#if( !$ctx.stash.get(\\"hasAuth\\") )
|
4754
|
-
$util.unauthorized()
|
4755
|
-
#end
|
4756
|
-
$util.toJson({})
|
4757
|
-
## [End] Sandbox Mode Disabled. **",
|
4758
|
-
"Subscription.onCreateNote.req.vtl": "## [Start] Subscription Request template. **
|
4759
|
-
$util.toJson({
|
4760
|
-
\\"version\\": \\"2018-05-29\\",
|
4761
|
-
\\"payload\\": {}
|
4762
|
-
})
|
4763
|
-
## [End] Subscription Request template. **",
|
4764
|
-
"Subscription.onCreateNote.res.vtl": "## [Start] Subscription Response template. **
|
4765
|
-
#if( !$util.isNullOrEmpty($ctx.args.filter) )
|
4766
|
-
$extensions.setSubscriptionFilter($util.transform.toSubscriptionFilter($ctx.args.filter))
|
4767
|
-
#end
|
4768
|
-
$util.toJson(null)
|
4769
|
-
## [End] Subscription Response template. **",
|
4770
|
-
"Subscription.onDeleteNote.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. **
|
4771
|
-
#if( !$ctx.stash.get(\\"hasAuth\\") )
|
4772
|
-
$util.unauthorized()
|
4773
|
-
#end
|
4774
|
-
$util.toJson({})
|
4775
|
-
## [End] Sandbox Mode Disabled. **",
|
4776
|
-
"Subscription.onDeleteNote.req.vtl": "## [Start] Subscription Request template. **
|
4777
|
-
$util.toJson({
|
4778
|
-
\\"version\\": \\"2018-05-29\\",
|
4779
|
-
\\"payload\\": {}
|
4780
|
-
})
|
4781
|
-
## [End] Subscription Request template. **",
|
4782
|
-
"Subscription.onDeleteNote.res.vtl": "## [Start] Subscription Response template. **
|
4783
|
-
#if( !$util.isNullOrEmpty($ctx.args.filter) )
|
4784
|
-
$extensions.setSubscriptionFilter($util.transform.toSubscriptionFilter($ctx.args.filter))
|
4785
|
-
#end
|
4786
|
-
$util.toJson(null)
|
4787
|
-
## [End] Subscription Response template. **",
|
4788
|
-
"Subscription.onUpdateNote.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. **
|
4789
|
-
#if( !$ctx.stash.get(\\"hasAuth\\") )
|
4790
|
-
$util.unauthorized()
|
4791
|
-
#end
|
4792
|
-
$util.toJson({})
|
4793
|
-
## [End] Sandbox Mode Disabled. **",
|
4794
|
-
"Subscription.onUpdateNote.req.vtl": "## [Start] Subscription Request template. **
|
4795
|
-
$util.toJson({
|
4796
|
-
\\"version\\": \\"2018-05-29\\",
|
4797
|
-
\\"payload\\": {}
|
4798
|
-
})
|
4799
|
-
## [End] Subscription Request template. **",
|
4800
|
-
"Subscription.onUpdateNote.res.vtl": "## [Start] Subscription Response template. **
|
4801
|
-
#if( !$util.isNullOrEmpty($ctx.args.filter) )
|
4802
|
-
$extensions.setSubscriptionFilter($util.transform.toSubscriptionFilter($ctx.args.filter))
|
4803
|
-
#end
|
4804
|
-
$util.toJson(null)
|
4805
|
-
## [End] Subscription Response template. **",
|
4806
|
-
}
|
4807
|
-
`;
|
4808
|
-
|
4809
4121
|
exports[`ModelTransformer: should successfully transform simple Embeddable type (non-model) schema 1`] = `
|
4810
4122
|
"type NonModelType {
|
4811
4123
|
id: ID!
|