16 lines
430 B
TypeScript
16 lines
430 B
TypeScript
import "server-only"
|
|
|
|
import { cacheExchange, createClient, fetchExchange } from "@urql/core";
|
|
import { registerUrql } from "@urql/next/rsc";
|
|
|
|
const makeClient = () => {
|
|
return createClient({
|
|
url: process.env.GRAPHQL_ENDPOINT ?? "",
|
|
exchanges: [cacheExchange, fetchExchange],
|
|
// requestPolicy: "network-only",
|
|
fetchOptions: { cache: "no-store" },
|
|
});
|
|
};
|
|
|
|
export const { getClient } = registerUrql(makeClient);
|