"use client"; import type { TypedDocumentNode } from "@apollo/client"; import { gql } from "@apollo/client"; import { useQuery, useSuspenseQuery } from "@apollo/client/react"; const QUERY: TypedDocumentNode<{ products: { id: string; title: string; }[]; }> = gql` query dynamicProducts { products { id title } } `; export const dynamic = "force-dynamic"; export default function Page() { useSuspenseQuery(QUERY); // fill cache with `useSuspenseQuery` const result = useQuery(QUERY); globalThis.hydrationFinished?.(); if (!result.data) { return
Loading...
; } return ( ); }