UNPKG

820 BTypeScriptView Raw
1/// <reference types="node" />
2import { IncomingMessage, ServerResponse } from 'http';
3export declare const GRAPHQL_MULTIPART_REQUEST_SPEC_URL: string;
4export interface UploadOptions {
5 maxFieldSize?: number | undefined;
6 maxFileSize?: number | undefined;
7 maxFiles?: number | undefined;
8}
9export interface GraphQLOperation {
10 query: string;
11 operationName?: null | string | undefined;
12 variables?: null | unknown | undefined | any;
13}
14export type IncomingReq = Partial<IncomingMessage> & {
15 body?: string;
16 rawBody?: string;
17 req?: any;
18 pipe?: any;
19 unpipe?: any;
20 once?: any;
21 resume?: any;
22};
23export declare function processRequest<T = any>(request?: IncomingReq, response?: Partial<ServerResponse>, options?: UploadOptions): Promise<GraphQLOperation | GraphQLOperation[] | T>;