You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/routing/errors.mdx
+34-18Lines changed: 34 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,9 +71,41 @@ You can create Rhai scripts that throw custom status codes. See [Terminating cli
71
71
72
72
</Note>
73
73
74
-
## GraphQL error codes
74
+
## GraphQL spec error codes
75
75
76
-
GraphQL error codes can appear in client responses under `errors[].extensions.code`, which is an established convention found in [GraphQL error extensions](https://spec.graphql.org/October2021/#sec-Errors.Error-result-format). Learn how to see these error codes in Studio via [extended error metrics](/graphos/routing/graphos-reporting#enabling-extended-error-reporting).
76
+
These error codes are defined in the [GraphQL spec](https://spec.graphql.org/October2021/) and can appear in client responses under `errors[].extensions.code`, which is an established convention found in [GraphQL error extensions](https://spec.graphql.org/October2021/#sec-Errors.Error-result-format). Because these error codes are part of the core spec, you can't disable them. Only Apollo Router-specific features or subgraph errors can be disabled.
77
+
78
+
Changing these errors makes your router non-compliant with the GraphQL spec. If you need to change these errors, you need to use an external system, such as an HTTP proxy layer.
79
+
80
+
Learn how to see these error codes in Studio with [extended error reporting](/graphos/routing/graphos-reporting#enabling-extended-error-reporting).
81
+
82
+
<PropertyListkind="errCodes">
83
+
84
+
85
+
<Propertyname="GRAPHQL_VALIDATION_FAILED">
86
+
87
+
The operation failed during GraphQL validation.
88
+
89
+
</Property>
90
+
<Propertyname="GRAPHQL_UNKNOWN_OPERATION_NAME">
91
+
92
+
The operation could not be executed because the operation name was invalid or
93
+
did not match an operation in the query document.
94
+
95
+
</Property>
96
+
<Propertyname="PARSING_ERROR">
97
+
98
+
The operation could not be parsed as GraphQL.
99
+
100
+
</Property>
101
+
102
+
</PropertyList>
103
+
104
+
## Apollo Router error codes
105
+
106
+
Additional error codes can appear in client responses under `errors[].extensions.code`, which is an established convention found in [GraphQL error extensions](https://spec.graphql.org/October2021/#sec-Errors.Error-result-format). Learn how to see these error codes in Studio with [extended error reporting](/graphos/routing/graphos-reporting#enabling-extended-error-reporting).
107
+
108
+
You can suppress or disable these error codes using [router customizations](/graphos/routing/customization/overview).
77
109
78
110
<PropertyListkind="errCodes">
79
111
@@ -112,17 +144,6 @@ The response from a subgraph did not match the GraphQL schema.
112
144
113
145
The request timed out when fetching data from a connector service.
114
146
115
-
</Property>
116
-
<Propertyname="GRAPHQL_VALIDATION_FAILED">
117
-
118
-
The operation failed during GraphQL validation.
119
-
120
-
</Property>
121
-
<Propertyname="GRAPHQL_UNKNOWN_OPERATION_NAME">
122
-
123
-
The operation could not be executed because the operation name was invalid or
124
-
did not match an operation in the query document.
125
-
126
147
</Property>
127
148
<Propertyname="HTTP_CLIENT_ERROR">
128
149
@@ -154,11 +175,6 @@ The operation was not executed due to exceeding the `max_root_fields` limit.
154
175
155
176
The operation was not executed because safelisting is enabled and the freeform GraphQL document provided was not found in the persisted query safelist.
0 commit comments