urql-devtools-exchange icon indicating copy to clipboard operation
urql-devtools-exchange copied to clipboard

Stuck in "Waiting for exchange"

Open tomconnors opened this issue 1 year ago • 2 comments

Hello and thanks for URQL.

I'm attempting to set up the devtools in a basic web app. I've added the devtools exchange to the client, but the URQL panel in the dev tools says "Waiting for exchange". How can I debug this?

Here's my client config code for reference:

import { Client, fetchExchange, gql } from "@urql/svelte";
import { cacheExchange } from "@urql/exchange-graphcache";
import { devtoolsExchange } from "@urql/devtools";
import * as util from '@/lib/util';

export default function client() {
    const client = new Client({
        url: "http://localhost:4040/api/report-graphql",
        exchanges: [
            devtoolsExchange,
            cacheExchange({ ... }),
            fetchExchange,
        ],
        fetchOptions: () => {
            const csrfToken = util.csrfToken();
            return {
                headers: { "X-CSRF-Token": csrfToken },
            };
        },
    });

    return client;
}


tomconnors avatar May 26 '23 22:05 tomconnors