Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 930 Bytes

README.md

File metadata and controls

37 lines (26 loc) · 930 Bytes

This is a reproducible example code which uses URQL with Next.js (v13, App Router) framework.

Reproduction Steps:

  1. Run app
$ npm install
$ npm run dev
  1. Open a web browser and visit http://localhost:3000 then open Developer Tools.

  2. Click the link that will lead you to '/query' page.

  3. Check the console messages. (Sometimes it works fine but Reload will trigger the Problem.)

import { createUrqlClientAndSsr } from "@/graphql";

export default function GqlProvider({ children }: React.PropsWithChildren) {
  const [client, ssr] = React.useMemo(() => {
    console.log("GqlProvider useMemo called");
    return createUrqlClientAndSsr();
  }, []);

  return (
    <UrqlProvider client={client} ssr={ssr}>
      {children}
    </UrqlProvider>
  );
}

  • I don't know why GqlProvder is initializing infinitely.