Libraries
    Preparing search index...

    Options for the batching middleware.

    interface BatchingOptions {
        batchPath?: string;
        maxSize?: number;
        skip?: (url: string, init: RequestInit) => boolean;
        windowMs?: number;
    }
    Index

    Properties

    batchPath?: string

    URL path of the server-side batch endpoint.

    Must match the path configured via ServerBuilder.useBatching() on the server (default '/__batch').

    '/__batch'
    
    maxSize?: number

    Maximum number of requests to include in a single batch.

    When the queue reaches this size the batch is flushed immediately, before the windowMs timer fires.

    10
    
    skip?: (url: string, init: RequestInit) => boolean

    Predicate to exclude specific requests from batching.

    Return true to send the request immediately, bypassing the batch queue. Useful for streaming endpoints, file uploads, or requests that must not be delayed.

    Type Declaration

      • (url: string, init: RequestInit): boolean
      • Parameters

        • url: string

          The fully-resolved request URL.

        • init: RequestInit

          The RequestInit object for the request.

        Returns boolean

    windowMs?: number

    Time window in milliseconds to collect requests before flushing.

    The first request in a new window starts the timer. All subsequent requests received before the timer fires are included in the same batch.

    10