web: start using graphql-codegen, switch to urql, use graphql data a few places
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
import { ApolloClient, HttpLink, InMemoryCache } from "@apollo/client";
|
||||
import { registerApolloClient } from "@apollo/experimental-nextjs-app-support/rsc";
|
||||
import { cacheExchange, createClient, fetchExchange } from "@urql/core";
|
||||
import { registerUrql } from "@urql/next/rsc";
|
||||
|
||||
export const { getClient } = registerApolloClient(() => {
|
||||
return new ApolloClient({
|
||||
cache: new InMemoryCache(),
|
||||
link: new HttpLink({
|
||||
uri: "https://cms.neuf.kult.444.no/api/graphql/",
|
||||
}),
|
||||
const makeClient = () => {
|
||||
return createClient({
|
||||
url: process.env.GRAPHQL_ENDPOINT ?? "",
|
||||
exchanges: [cacheExchange, fetchExchange],
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
export const { getClient } = registerUrql(makeClient);
|
||||
|
Reference in New Issue
Block a user