web: start using graphql-codegen, switch to urql, use graphql data a few places

This commit is contained in:
2024-05-10 04:45:53 +02:00
parent 97cfb05710
commit 6f021e4842
16 changed files with 5855 additions and 374 deletions

View File

@ -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);