Skip to content

Instantly share code, notes, and snippets.

View ardiewen's full-sized avatar

Ardie Wen ardiewen

  • CloudRaker
  • Toronto, ON, Canada
  • 05:59 (UTC -05:00)
View GitHub Profile
@ardiewen
ardiewen / client.js
Last active July 28, 2021 01:55
Example of modifying the existing "with-apollo" NextJS example with wp-graphql-woocommerce middleware.
import { useMemo } from 'react'
import { ApolloClient, InMemoryCache, from } from '@apollo/client'
import merge from 'deepmerge'
import isEqual from 'lodash/isEqual'
import {
httpLink,
onErrorLink,
wooSessionMiddleware,
wooSessionAfterware,
} from 'lib/apollo/middleware'