/urql-devtools-exchange

The exchange for usage with Urql Devtools

Primary LanguageTypeScriptMIT LicenseMIT

logo

urql devtools exchange

Spectrum badge

The official devtools exchange for use with urql devtools chrome extension.

Requirements

Usage

Install the devtools exchange

# yarn
yarn add -D @urql/devtools

# npm
npm i -D @urql/devtools

Add the devtools exchange to your urql client

// ...
import { defaultExchanges, createClient } from '@urql/core';
import { devtoolsExchange } from '@urql/devtools';

// ...
const client = createClient({
  url: 'http://localhost:3001/graphql',
  exchanges: [
    // replacing devtools with a passthrough exchange for production environments
    process.env.NODE_ENV !== 'production'
      ? devtoolsExchange
      : ({ forward }) => forward,
    ...defaultExchanges,
  ],
});

Contributing

Have experience working with devtools extensions or want to get involved? Check out our contributing docs to get started.