File tree 3 files changed +12
-6
lines changed
3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 52
52
53
53
### status
54
54
55
- • ** status** : `` "warn" `` \| `` "error" ``
55
+ • ** status** : `` "notice" `` \| `` " warn"`` \| `` "error" ``
Original file line number Diff line number Diff line change @@ -252,14 +252,17 @@ Creates an appropriate GraphQL over HTTP response following the provided argumen
252
252
253
253
If the first argument is an ` ExecutionResult ` , the operation will be treated as "successful".
254
254
255
- If the first argument is _ any_ object without the ` data ` field, it will be treated as an error (as per the spec)
256
- and the response will be constructed with the help of ` acceptedMediaType ` complying with the GraphQL over HTTP spec.
255
+ If the first argument is (an array of) ` GraphQLError ` , or an ` ExecutionResult ` without the ` data ` field, it will be treated
256
+ the response will be constructed with the help of ` acceptedMediaType ` complying with the GraphQL over HTTP spec.
257
+
258
+ If the first argument is an ` Error ` , the operation will be treated as a bad request responding with ` 400: Bad Request ` and the
259
+ error will be present in the ` ExecutionResult ` style.
257
260
258
261
#### Parameters
259
262
260
263
| Name | Type |
261
264
| :------ | :------ |
262
- | ` resultOrErrors ` | readonly ` GraphQLError ` [ ] \| ` Readonly ` <` ExecutionResult ` <` ObjMap ` <` unknown ` \> , ` ObjMap ` <` unknown ` \>\>\> \| ` Readonly ` <` GraphQLError ` \> |
265
+ | ` resultOrErrors ` | readonly ` GraphQLError ` [ ] \| ` Readonly ` <` ExecutionResult ` <` ObjMap ` <` unknown ` \> , ` ObjMap ` <` unknown ` \>\>\> \| ` Readonly ` <` GraphQLError ` \> \| ` Readonly ` < ` Error ` \> |
263
266
| ` acceptedMediaType ` | [ ` AcceptableMediaType ` ] ( handler.md#acceptablemediatype ) |
264
267
265
268
#### Returns
Original file line number Diff line number Diff line change @@ -704,8 +704,11 @@ export function getAcceptableMediaType(
704
704
*
705
705
* If the first argument is an `ExecutionResult`, the operation will be treated as "successful".
706
706
*
707
- * If the first argument is _any_ object without the `data` field, it will be treated as an error (as per the spec)
708
- * and the response will be constructed with the help of `acceptedMediaType` complying with the GraphQL over HTTP spec.
707
+ * If the first argument is (an array of) `GraphQLError`, or an `ExecutionResult` without the `data` field, it will be treated
708
+ * the response will be constructed with the help of `acceptedMediaType` complying with the GraphQL over HTTP spec.
709
+ *
710
+ * If the first argument is an `Error`, the operation will be treated as a bad request responding with `400: Bad Request` and the
711
+ * error will be present in the `ExecutionResult` style.
709
712
*
710
713
* @category Server
711
714
*/
You can’t perform that action at this time.
0 commit comments