|
11 | 11 |
|
12 | 12 | from gql import Client, gql
|
13 | 13 |
|
| 14 | +static_result = { |
| 15 | + "edges": [ |
| 16 | + { |
| 17 | + "node": { |
| 18 | + "from": {"address": "0x45b9ad45995577fe"}, |
| 19 | + "to": {"address": "0x6394e988297f5ed2"}, |
| 20 | + } |
| 21 | + }, |
| 22 | + {"node": {"from": None, "to": {"address": "0x6394e988297f5ed2"}}}, |
| 23 | + ] |
| 24 | +} |
14 | 25 |
|
15 |
| -def static_result(root, _info, count): |
16 |
| - return { |
17 |
| - "edges": [ |
18 |
| - { |
19 |
| - "node": { |
20 |
| - "from": {"address": "0x45b9ad45995577fe"}, |
21 |
| - "to": {"address": "0x6394e988297f5ed2"}, |
22 |
| - } |
23 |
| - }, |
24 |
| - {"node": {"from": None, "to": {"address": "0x6394e988297f5ed2"}}}, |
25 |
| - ] |
26 |
| - } |
| 26 | + |
| 27 | +def resolve_test(root, _info, count): |
| 28 | + return static_result |
27 | 29 |
|
28 | 30 |
|
29 | 31 | Account = GraphQLObjectType(
|
@@ -60,7 +62,7 @@ def static_result(root, _info, count):
|
60 | 62 | },
|
61 | 63 | ),
|
62 | 64 | args={"count": GraphQLArgument(GraphQLInt)},
|
63 |
| - resolve=static_result, |
| 65 | + resolve=resolve_test, |
64 | 66 | ),
|
65 | 67 | },
|
66 | 68 | )
|
@@ -92,15 +94,5 @@ def test_parse_results_null_mapping():
|
92 | 94 | )
|
93 | 95 |
|
94 | 96 | assert client.execute(query, variable_values={"count": 2}) == {
|
95 |
| - "test": { |
96 |
| - "edges": [ |
97 |
| - { |
98 |
| - "node": { |
99 |
| - "from": {"address": "0x45b9ad45995577fe"}, |
100 |
| - "to": {"address": "0x6394e988297f5ed2"}, |
101 |
| - } |
102 |
| - }, |
103 |
| - {"node": {"from": None, "to": {"address": "0x6394e988297f5ed2"}}}, |
104 |
| - ] |
105 |
| - } |
| 97 | + "test": static_result |
106 | 98 | }
|
0 commit comments