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: src/use/fastify.ts
+75-9Lines changed: 75 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,11 @@ import type { FastifyRequest, FastifyReply, RouteHandler } from 'fastify';
2
2
import{
3
3
createHandlerascreateRawHandler,
4
4
HandlerOptionsasRawHandlerOptions,
5
+
RequestasRawRequest,
6
+
parseRequestParamsasrawParseRequestParams,
5
7
OperationContext,
6
8
}from'../handler';
9
+
import{RequestParams}from'../common';
7
10
8
11
/**
9
12
* The context in the request for the handler.
@@ -13,6 +16,62 @@ import {
13
16
exportinterfaceRequestContext{
14
17
reply: FastifyReply;
15
18
}
19
+
/**
20
+
* The GraphQL over HTTP spec compliant request parser for an incoming GraphQL request.
21
+
*
22
+
* If the HTTP request _is not_ a [well-formatted GraphQL over HTTP request](https://graphql.github.io/graphql-over-http/draft/#sec-Request), the function will respond
23
+
* on the `Response` argument and return `null`.
24
+
*
25
+
* If the HTTP request _is_ a [well-formatted GraphQL over HTTP request](https://graphql.github.io/graphql-over-http/draft/#sec-Request), but is invalid or malformed,
26
+
* the function will throw an error and it is up to the user to handle and respond as they see fit.
27
+
*
28
+
* ```js
29
+
* import Fastify from 'fastify'; // yarn add fastify
30
+
* import { parseRequestParams } from 'graphql-http/lib/use/fastify';
0 commit comments