UNPKG

@wener/console

Version:
17 lines (16 loc) 587 B
import { getGlobalStates, setGlobalStates } from "@wener/utils"; import { getAccessToken } from "../../console/context.js"; import { createUrqlClient } from "../../urql/index.js"; import { getGraphQLUrl } from "./getGraphQLUrl.js"; var _UrqlClientStateKey = "UrqlClient"; export function getUrqlClient() { return getGlobalStates(_UrqlClientStateKey, function () { return createUrqlClient({ getToken: getAccessToken, url: getGraphQLUrl() }); }); } export function setUrlqClient(client) { setGlobalStates(_UrqlClientStateKey, client); }