From 0722cc0628a7507e2e916602d2d19134899bf98b Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Wed, 14 Sep 2022 16:04:50 +0300 Subject: [PATCH] fixx --- src/components/Views/publicGraphQLClient.ts | 23 +++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/components/Views/publicGraphQLClient.ts diff --git a/src/components/Views/publicGraphQLClient.ts b/src/components/Views/publicGraphQLClient.ts new file mode 100644 index 00000000..4e88dc8d --- /dev/null +++ b/src/components/Views/publicGraphQLClient.ts @@ -0,0 +1,23 @@ +import { ClientOptions, dedupExchange, fetchExchange, createClient, Exchange } from '@urql/core' +import { devtoolsExchange } from '@urql/devtools' + +// FIXME actual value +const isDev = true + +// export const baseUrl = 'https://.discours.io' +export const baseUrl = 'http://localhost:8000' + +const exchanges: Exchange[] = [dedupExchange, fetchExchange] + +if (isDev) { + exchanges.unshift(devtoolsExchange) +} + +const options: ClientOptions = { + url: baseUrl, + maskTypename: true, + requestPolicy: 'cache-and-network', + exchanges +} + +export const publicGraphQLClient = createClient(options)