diff --git a/packages/core/src/common/types/common-types.ts b/packages/core/src/common/types/common-types.ts index 0a8416987b..044e27fffa 100644 --- a/packages/core/src/common/types/common-types.ts +++ b/packages/core/src/common/types/common-types.ts @@ -181,6 +181,28 @@ export type MiddlewareHandler = Type | Function; * Defines API middleware, set in the {@link ApiOptions}. Middleware can be either * [Express middleware](https://expressjs.com/en/guide/using-middleware.html) or [NestJS middleware](https://docs.nestjs.com/middleware). * + * ## Increasing the maximum request body size limit + * + * Internally, Vendure relies on the body-parser middleware to parse incoming JSON data. By default, the maximum + * body size is set to 100kb. Attempting to send a request with more than 100kb of JSON data will result in a + * `PayloadTooLargeError`. To increase this limit, we can manually configure the body-parser middleware: + * + * @example + * ```TypeScript + * import { VendureConfig } from '\@vendure/core'; + * import { json } from 'body-parser'; + * + * export const config: VendureConfig = { + * // ... + * apiOptions: { + * middleware: [{ + * handler: json({ limit: '10mb' }), + * route: '*', + * beforeListen: true, + * }], + * }, + * }; + * * @docsCategory Common */ export interface Middleware {