Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

(next) - allow subsequent statically generated pages to hydrate the ssr-cache (#1602)

* allow subsequent statically generated pages to hydrate the ssr-cache

* remove testing code

authored by

Jovi De Croock and committed by
GitHub
b501be8a f02178f3

+8
+5
.changeset/witty-spiders-matter.md
··· 1 + --- 2 + 'next-urql': minor 3 + --- 4 + 5 + Allow subsequent static-pages to hydrate the cache
+1
examples/with-next/package.json
··· 11 11 "urql": "^2.0.2" 12 12 }, 13 13 "scripts": { 14 + "dev": "next dev", 14 15 "start": "next", 15 16 "build": "next build" 16 17 }
+2
packages/next-urql/src/with-urql-client.ts
··· 55 55 if (!ssr || typeof window === 'undefined') { 56 56 // We want to force the cache to hydrate, we do this by setting the isClient flag to true 57 57 ssr = ssrExchange({ initialState: urqlServerState, isClient: true }); 58 + } else if (ssr && typeof window !== 'undefined') { 59 + ssr.restoreData(urqlServerState); 58 60 } 59 61 60 62 const clientConfig = getClientConfig(ssr);