forked from jaydenseric/graphql-upload
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraphqlUploadExpress.d.ts
32 lines (32 loc) · 1.41 KB
/
graphqlUploadExpress.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
export = graphqlUploadExpress;
/**
* Creates [Express](https://expressjs.com) middleware that processes incoming
* [GraphQL multipart requests](https://github.com/jaydenseric/graphql-multipart-request-spec)
* using {@linkcode processRequest}, ignoring non multipart requests. It sets
* the request `body` to be similar to a conventional GraphQL POST request for
* following GraphQL middleware to consume.
* @param {import("./processRequest.js").ProcessRequestOptions & {
* processRequest?: import("./processRequest.js").ProcessRequestFunction
* }} options Options.
* @returns Express middleware.
* @example
* Basic [`express-graphql`](https://npm.im/express-graphql) setup:
*
* ```js
* const express = require("express");
* const graphqlHTTP = require("express-graphql");
* const graphqlUploadExpress = require("graphql-upload/graphqlUploadExpress.js");
* const schema = require("./schema.js");
*
* express()
* .use(
* "/graphql",
* graphqlUploadExpress({ maxFileSize: 10000000, maxFiles: 10 }),
* graphqlHTTP({ schema })
* )
* .listen(3000);
* ```
*/
declare function graphqlUploadExpress({ processRequest, ...processRequestOptions }?: import("./processRequest.js").ProcessRequestOptions & {
processRequest?: import("./processRequest.js").ProcessRequestFunction;
}): (request: import("express").Request, response: import("express").Response, next: import("express").NextFunction) => void;