-
Notifications
You must be signed in to change notification settings - Fork 2
/
resolvers.yml
53 lines (50 loc) · 1.28 KB
/
resolvers.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
functions:
- dataSource: none_datasource
name: todo_one
requestMappingTemplate: '
#set( $event = {
"id": "test",
"name": "Some todo"
} )
{
"version" : "2018-05-29",
"payload": $util.toJson($event)
}
'
responseMappingTemplate: $util.toJson($context.result)
- dataSource: none_datasource
name: todo_two
requestMappingTemplate: '
#set( $event = {
"id": $context.prev.result.id,
"name": $context.prev.result.name,
"description": 42,
"priority": 123
} )
{
"version" : "2018-05-29",
"payload": $util.toJson($event)
}
'
responseMappingTemplate: $util.toJson($context.result)
resolvers:
- dataSource: none_datasource
typeName: Query
fieldName: getTodos
requestMappingTemplate: >
\#set( $payload = {
"bar" : $context.request.foo
} )
{
"version" : "2017-02-28",
"operation": "Invoke",
"payload": $util.toJson($payload)
}
responseMappingTemplate: $util.toJson($context.result)
- typeName: Query
fieldName: todo
functions:
- todo_one
- todo_two
requestMappingTemplate: '{}'
responseMappingTemplate: $util.toJson($context.result)