@apollo/client-react-streaming
Version:
This package provides building blocks to create framework-level integration of Apollo Client with React's streaming SSR. See the [@apollo/client-integration-nextjs](https://github.com/apollographql/apollo-client-integrations/tree/main/packages/nextjs) pac
39 lines • 1.58 kB
TypeScript
import { ApolloLink } from "@apollo/client";
import { Observable } from "@apollo/client/utilities";
interface AccumulateMultipartResponsesConfig {
/**
* The maximum delay in milliseconds
* from receiving the first response
* until the accumulated data will be flushed
* and the connection will be closed.
*/
cutoffDelay: number;
}
/**
*
* This link can be used to "debounce" the initial response of a multipart request. Any incremental data received during the `cutoffDelay` time will be merged into the initial response.
*
* After `cutoffDelay`, the link will return the initial response, even if there is still incremental data pending, and close the network connection.
*
* If `cutoffDelay` is `0`, the link will immediately return data as soon as it is received, without waiting for incremental data, and immediately close the network connection.
*
* @example
* ```ts
* new AccumulateMultipartResponsesLink({
* // The maximum delay in milliseconds
* // from receiving the first response
* // until the accumulated data will be flushed
* // and the connection will be closed.
* cutoffDelay: 100,
* });
* ```
*
* @public
*/
export declare class AccumulateMultipartResponsesLink extends ApolloLink {
private maxDelay;
constructor(config: AccumulateMultipartResponsesConfig);
request(operation: ApolloLink.Operation, forward?: ApolloLink.ForwardFunction): Observable<ApolloLink.Result<Record<string, any>, Record<string, any>>>;
}
export {};
//# sourceMappingURL=AccumulateMultipartResponsesLink.d.ts.map