Interface ExchangeInput

The input parameters a Client passes to an Exchange when it's created.


When instantiated, a Client passes these inputs parameters to an Exchange.

This input contains the Client itself, a dispatchDebug function for the urql-devtools, and forward, which is set to the next exchange's ExchangeIO function in the exchange pipeline.


  • ExchangeInput




client: Client

The Client that is using this Exchange.


The Client instantiating the Exchange will call it with the ExchangeInput object, while setting client to itself.

Exchanges use methods like reexecuteOperation to issue Operations themselves, and communicate with the exchange pipeline as a whole.

forward: ExchangeIO

The next Exchange's ExchangeIO function in the pipeline.


Exchanges are like middleware function, and are henced composed like a recursive pipeline. Each Exchange will receive the next Exchange's ExchangeIO function which they then call to compose each other.

Since each Exchange calls the next, this creates a pipeline where operations are forwarded in sequence and OperationResults from the next Exchange are combined with the current.


  • Issues a debug event to the urql-devtools.


    If @urql/devtools are set up, this dispatch function issues events to the urql-devtools. These events give the devtools more granular insights on what's going on in exchanges asynchronously, since Operations and OperationResults only signify the “start” and “end” of a request.

    Type Parameters

    • T extends string


    Returns void

Generated using TypeDoc