UNPKG

@quell/server

Version:

Quell is an open-source NPM package providing a light-weight caching layer implementation and cache invalidation for GraphQL responses on both the client- and server-side. Use Quell to prevent redundant client-side API requests and to minimize costly serv

17 lines 941 B
import { Request, Response, NextFunction } from "express"; export interface DepthLimitConfig { maxDepth: number; } /** * Takes in the query, parses it, and identifies the general shape of the request in order * to compare the query's depth to the depth limit set on server connection. * * In the instance of a malicious or overly nested query, short-circuits the query before * it goes to the database and passes an error with a status code 413 (content too large). * @param {Object} req - Express request object * @param {Object} res - Express response object * @param {Function} next - Express next middleware function * @returns {void} Passes an error to Express if no query was included in the request or if the depth exceeds the maximum allowed depth. */ export declare function createDepthLimit(config: DepthLimitConfig): (req: Request, res: Response, next: NextFunction) => void; //# sourceMappingURL=depthLimit.d.ts.map