Skip to content

Commit fec934f

Browse files
committed
gendocs
1 parent 7e7dc48 commit fec934f

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

Diff for: docs/interfaces/handler.HandlerOptions.md

+11
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
- [onOperation](handler.HandlerOptions.md#onoperation)
2424
- [onSubscribe](handler.HandlerOptions.md#onsubscribe)
2525
- [parse](handler.HandlerOptions.md#parse)
26+
- [parseRequestParams](handler.HandlerOptions.md#parserequestparams)
2627
- [rootValue](handler.HandlerOptions.md#rootvalue)
2728
- [schema](handler.HandlerOptions.md#schema)
2829
- [validate](handler.HandlerOptions.md#validate)
@@ -203,6 +204,16 @@ GraphQL parse function allowing you to apply a custom parser.
203204

204205
___
205206

207+
### parseRequestParams
208+
209+
`Optional` **parseRequestParams**: [`ParseRequestParams`](../modules/handler.md#parserequestparams)<`RequestRaw`, `RequestContext`\>
210+
211+
The request parser for an incoming GraphQL request.
212+
213+
Read more about it in [ParseRequestParams](../modules/handler.md#parserequestparams).
214+
215+
___
216+
206217
### rootValue
207218

208219
`Optional` **rootValue**: `unknown`

Diff for: docs/modules/handler.md

+43
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- [Handler](handler.md#handler)
1717
- [OperationArgs](handler.md#operationargs)
1818
- [OperationContext](handler.md#operationcontext)
19+
- [ParseRequestParams](handler.md#parserequestparams)
1920
- [RequestHeaders](handler.md#requestheaders)
2021
- [Response](handler.md#response)
2122
- [ResponseBody](handler.md#responsebody)
@@ -108,6 +109,48 @@ the `context` server option.
108109

109110
___
110111

112+
### ParseRequestParams
113+
114+
Ƭ **ParseRequestParams**<`RequestRaw`, `RequestContext`\>: (`req`: [`Request`](../interfaces/handler.Request.md)<`RequestRaw`, `RequestContext`\>) => `Promise`<[`RequestParams`](../interfaces/common.RequestParams.md) \| [`Response`](handler.md#response) \| `void`\> \| [`RequestParams`](../interfaces/common.RequestParams.md) \| [`Response`](handler.md#response) \| `void`
115+
116+
#### Type parameters
117+
118+
| Name | Type |
119+
| :------ | :------ |
120+
| `RequestRaw` | `unknown` |
121+
| `RequestContext` | `unknown` |
122+
123+
#### Type declaration
124+
125+
▸ (`req`): `Promise`<[`RequestParams`](../interfaces/common.RequestParams.md) \| [`Response`](handler.md#response) \| `void`\> \| [`RequestParams`](../interfaces/common.RequestParams.md) \| [`Response`](handler.md#response) \| `void`
126+
127+
The request parser for an incoming GraphQL request. It parses and validates the
128+
request itself, including the request method and the content-type of the body.
129+
130+
In case you are extending the server to handle more request types, this is the
131+
perfect place to do so.
132+
133+
If an error is thrown, it will be formatted using the provided [FormatError](handler.md#formaterror)
134+
and handled following the spec to be gracefully reported to the client.
135+
136+
Throwing an instance of `Error` will _always_ have the client respond with a `400: Bad Request`
137+
and the error's message in the response body; however, if an instance of `GraphQLError` is thrown,
138+
it will be reported depending on the accepted content-type.
139+
140+
If you return nothing, the default parser will be used instead.
141+
142+
##### Parameters
143+
144+
| Name | Type |
145+
| :------ | :------ |
146+
| `req` | [`Request`](../interfaces/handler.Request.md)<`RequestRaw`, `RequestContext`\> |
147+
148+
##### Returns
149+
150+
`Promise`<[`RequestParams`](../interfaces/common.RequestParams.md) \| [`Response`](handler.md#response) \| `void`\> \| [`RequestParams`](../interfaces/common.RequestParams.md) \| [`Response`](handler.md#response) \| `void`
151+
152+
___
153+
111154
### RequestHeaders
112155

113156
Ƭ **RequestHeaders**: { `[key: string]`: `string` \| `string`[] \| `undefined`; `set-cookie?`: `string` \| `string`[] } \| { `get`: (`key`: `string`) => `string` \| ``null`` }

0 commit comments

Comments
 (0)