We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6545533 + c449866 commit 41f5abbCopy full SHA for 41f5abb
src/index.ts
@@ -1,7 +1,16 @@
1
import * as bodyParser from 'body-parser'
2
import { Request, Response, NextFunction, RequestHandler } from 'express'
3
4
-export const bodyParserGraphQL: () => RequestHandler = () => (
+export interface BodyParserJSONOptions {
5
+ limit?: number | string,
6
+ inflate?: boolean,
7
+ reviver?: any,
8
+ strict?: boolean,
9
+ type?: string,
10
+ verify?: any,
11
+}
12
+
13
+export const bodyParserGraphQL: (options?: BodyParserJSONOptions) => RequestHandler = (options?: BodyParserJSONOptions) => (
14
req: Request,
15
res: Response,
16
next: NextFunction
@@ -15,7 +24,7 @@ export const bodyParserGraphQL: () => RequestHandler = () => (
24
next()
25
})
17
26
} else {
18
- bodyParser.json()(req, res, next)
27
+ bodyParser.json(options)(req, res, next)
19
28
}
20
29
21
30
0 commit comments