@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
18 lines • 889 B
TypeScript
import { Request, Response, NextFunction } from "express";
import type { CostParamsType } from "../types/types";
export interface CostLimitConfig {
costParameters: CostParamsType;
schema?: any;
}
/**
* Checks the cost of the query. 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 cost exceeds the maximum allowed cost.
*/
export declare function createCostLimit(config: CostLimitConfig): (req: Request, res: Response, next: NextFunction) => void;
//# sourceMappingURL=costLimit.d.ts.map