Commit 1d3971d
committed
refactor(errors): proxy all the errors
Previously, errors with invalid or missing paths were lost.
See:
#1641
https://github.com/apollographql/apollo-server/issues/4226
They are now saved!
All correctly pathed errors are now inlined into the returned data by the CheckResultAndHandleErrors transform.
The data is now annotated only with the remaining "unpathed" errors. These are then returned when possible if a null is encountered including the missing or potentially invalid path.
Changes to error handling obviate some existing functions including getErrorsByPathSegment, getErrors in favor of getUnpathedErrors.
Utility functions including slicedError and unreleased functions extendedError and unextendedError are no longer necessary.1 parent 3051fdc commit 1d3971d
File tree
12 files changed
+269
-198
lines changed- packages
- delegate
- src
- resolveExternalValue
- transforms
- tests
- utils/src
- wrap/src
12 files changed
+269
-198
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | | - | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 3 | + | |
11 | 4 | | |
12 | 5 | | |
13 | | - | |
| 6 | + | |
14 | 7 | | |
15 | 8 | | |
16 | | - | |
| 9 | + | |
17 | 10 | | |
18 | 11 | | |
19 | 12 | | |
| |||
24 | 17 | | |
25 | 18 | | |
26 | 19 | | |
27 | | - | |
| 20 | + | |
28 | 21 | | |
29 | 22 | | |
30 | 23 | | |
| |||
33 | 26 | | |
34 | 27 | | |
35 | 28 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 29 | + | |
| 30 | + | |
69 | 31 | | |
70 | 32 | | |
71 | 33 | | |
| |||
95 | 57 | | |
96 | 58 | | |
97 | 59 | | |
98 | | - | |
99 | | - | |
| 60 | + | |
100 | 61 | | |
101 | 62 | | |
102 | 63 | | |
103 | | - | |
| 64 | + | |
104 | 65 | | |
105 | 66 | | |
106 | 67 | | |
| |||
118 | 79 | | |
119 | 80 | | |
120 | 81 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 82 | + | |
129 | 83 | | |
130 | 84 | | |
131 | 85 | | |
Lines changed: 11 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | | - | |
| 21 | + | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | | - | |
29 | | - | |
30 | | - | |
| 27 | + | |
31 | 28 | | |
32 | 29 | | |
33 | 30 | | |
34 | | - | |
| 31 | + | |
35 | 32 | | |
36 | 33 | | |
37 | 34 | | |
| |||
43 | 40 | | |
44 | 41 | | |
45 | 42 | | |
46 | | - | |
| 43 | + | |
47 | 44 | | |
48 | 45 | | |
49 | 46 | | |
50 | 47 | | |
51 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
52 | 53 | | |
53 | | - | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | | - | |
| 60 | + | |
60 | 61 | | |
61 | | - | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
Lines changed: 18 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
23 | 21 | | |
24 | | - | |
25 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
Lines changed: 2 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
| |||
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | | - | |
| 12 | + | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 20 | + | |
27 | 21 | | |
28 | 22 | | |
29 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
21 | | - | |
| 19 | + | |
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
27 | 25 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 26 | | |
44 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
45 | 32 | | |
46 | | - | |
| 33 | + | |
47 | 34 | | |
48 | 35 | | |
49 | 36 | | |
50 | 37 | | |
51 | 38 | | |
52 | | - | |
| 39 | + | |
53 | 40 | | |
54 | | - | |
| 41 | + | |
55 | 42 | | |
56 | 43 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
0 commit comments