Skip to content

Instantly share code, notes, and snippets.

View adrienpsl's full-sized avatar

adrien adrienpsl

View GitHub Profile
@adrienpsl
adrienpsl / next-apollo.tsx
Last active December 1, 2020 13:41
hydrate apollo
import { ApolloClient, ApolloProvider, NormalizedCacheObject } from '@apollo/client';
import { NextPage, NextPageContext } from 'next';
import App, { AppContext } from 'next/app';
import Head from 'next/head';
import React from 'react';
// On the client, we store the Apollo Client in the following variable.
// This prevents the client from reinitializing between page transitions.
let globalApolloClient: ApolloClient<NormalizedCacheObject> | null = null;
let hasSetInitialStore = false;
@adrienpsl
adrienpsl / .block
Last active January 10, 2020 00:09
fresh block
license: mit