dios-david / urql-devtools-exchange

The exchange for usage with Urql Devtools

Home Page:https://www.npmjs.com/package/@urql/devtools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

The exchange for usage with Urql Devtools

https://www.npmjs.com/package/@urql/devtools

License:MIT License


Languages

Language:TypeScript 71.3%Language:JavaScript 28.7%