Commit 5f911e1
authored
feat!: support partial responses (#610)
Adds support for proper error handling and partial responses as defined
by the spec, cf. https://spec.graphql.org/September2025/#sec-Errors
KGraphQL now distinguishes between _request_ and _execution_ errors, and
the latter now result in a response that contains both, `data` and
`errors`. Execution errors result in a value of `null` for nullable
fields, and will bubble up to their parent node for non-nullable fields.
Additionally, resolvers can now raise execution errors while still
returning data.
If data _and_ errors are present in the response, the `errors` key is
serialized first to make it more apparent that errors are present.
Behavior for request errors is unchanged, and `wrapErrors` configuration
is still supported for now - but likely subject to change in the future.
Resolves #114
BREAKING CHANGE: relying on exceptions being thrown from query execution
may no longer work as before. It is advised to specify `wrapErrors =
false` and report an issue with the respective use case.1 parent a10e181 commit 5f911e1
42 files changed
Lines changed: 1058 additions & 558 deletions
File tree
- docs/content/Reference
- gradle
- kgraphql-ktor-stitched
- api
- src
- main/kotlin/com/apurebase/kgraphql/stitched
- schema/execution
- test/kotlin/com/apurebase/kgraphql/stitched/schema/execution
- kgraphql-ktor/src/test/kotlin/com/apurebase/kgraphql
- kgraphql
- api
- src
- main/kotlin/com/apurebase/kgraphql
- helpers
- request
- schema
- builtin
- execution
- scalar
- testFixtures/kotlin/com/apurebase/kgraphql
- test/kotlin/com/apurebase/kgraphql
- access
- configuration
- integration
- schema
- specification
- introspection
- language
- typesystem
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
12 | 24 | | |
13 | 25 | | |
14 | 26 | | |
15 | 27 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
30 | 36 | | |
31 | 37 | | |
32 | 38 | | |
33 | | - | |
| 39 | + | |
34 | 40 | | |
35 | | - | |
| 41 | + | |
36 | 42 | | |
37 | | - | |
| 43 | + | |
38 | 44 | | |
39 | | - | |
| 45 | + | |
40 | 46 | | |
41 | | - | |
| 47 | + | |
42 | 48 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
48 | 71 | | |
49 | | - | |
50 | | - | |
51 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
52 | 100 | | |
| 101 | + | |
53 | 102 | | |
| 103 | + | |
54 | 104 | | |
55 | 105 | | |
56 | 106 | | |
57 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
58 | 134 | | |
59 | 135 | | |
60 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
61 | 147 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
75 | 155 | | |
76 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
77 | 159 | | |
78 | 160 | | |
79 | 161 | | |
80 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
81 | 177 | | |
82 | 178 | | |
83 | 179 | | |
| |||
94 | 190 | | |
95 | 191 | | |
96 | 192 | | |
97 | | - | |
98 | 193 | | |
99 | 194 | | |
100 | 195 | | |
| |||
121 | 216 | | |
122 | 217 | | |
123 | 218 | | |
124 | | - | |
125 | 219 | | |
126 | 220 | | |
127 | 221 | | |
128 | 222 | | |
| 223 | + | |
| 224 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | 1 | | |
6 | 2 | | |
7 | 3 | | |
| |||
kgraphql-ktor-stitched/src/main/kotlin/com/apurebase/kgraphql/stitched/RemoteExecutionException.kt
Lines changed: 0 additions & 17 deletions
This file was deleted.
0 commit comments