webapp/src/graphql/publicGraphQLClient.ts
Igor Lobanov 382d420f38 lint
2022-11-21 01:26:20 +01:00

20 lines
546 B
TypeScript

import { ClientOptions, dedupExchange, fetchExchange, Exchange, createClient } from '@urql/core'
import { devtoolsExchange } from '@urql/devtools'
import { isDev, apiBaseUrl } from '../utils/config'
// import { cache } from './cache'
const exchanges: Exchange[] = [dedupExchange, fetchExchange] //, cache]
if (isDev) {
exchanges.unshift(devtoolsExchange)
}
const options: ClientOptions = {
url: apiBaseUrl,
maskTypename: true,
requestPolicy: 'cache-and-network',
exchanges
}
export const publicGraphQLClient = createClient(options)