Interface ExchangeInput

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

Remarks

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.

Hierarchy

  • ExchangeInput

Properties

Methods

Properties

client: Client

The Client that is using this Exchange.

Remarks

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.

Remarks

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.

Methods

  • Issues a debug event to the urql-devtools.

    Remarks

    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

    Parameters

    Returns void

Generated using TypeDoc