message: Update apollo client setup to work with new style
diff: @@ -10,7 +10,6 @@ import {
  InMemoryCache,
  IntrospectionFragmentMatcher,
  } from 'apollo-cache-inmemory'
  -import { withClientState } from 'apollo-link-state'
  import { HelmetProvider } from 'react-helmet-async'
  import mount from 'v2/util/mount'
  @@ -54,9 +53,64 @@ export const initApolloClient = ({
  const { X_APP_TOKEN, X_SHARE_TOKEN } = sharifyData
  - const stateLink = withClientState({
  + const authLink = setContext((_, { headers }) => ({
  + headers: {
  + ...headers,
  + ...(X_AUTH_TOKEN && { 'X-AUTH-TOKEN': X_AUTH_TOKEN }),
  + ...(X_APP_TOKEN && { 'X-APP-TOKEN': X_APP_TOKEN }),
  + ...(X_SHARE_TOKEN && { 'X-SHARE-TOKEN': X_SHARE_TOKEN }),
  + },
  + }))
  +
  + const httpLink = isClientSide ? clientHttpLink : serverHttpLink
  +
  + const link = ApolloLink.from([authLink, httpLink])
  +
  + const typeDefs = `
  + extend type Query {
  + cookies: {
  + get(name: String!): Boolean | null
  + }
  + sharify: {
  + get(name: String!): Boolean | null
  + }
  + }
  + `
  +
  + const resolvers = {
  + Query: {
  + cookies: () => ({
  + __typename: 'Cookies',
  + }),
  + sharify: () => ({
  + __typename: 'Sharify',
  + }),
  + serializedMe: () => ({
  + __typename: 'SerializedMe',
  + }),
  + },
  + Cookies: {
  + get: (_obj, args) => {
  + return cookies[args.name] || null
  + },
  + },
  + Sharify: {
  + get: (_obj, args) => {
  + const value = sharifyData[args.name]
  + return value === undefined ? null : value
  + },
  + },
  + }
  +
  + const client = new ApolloClient({
  + ssrMode: !isClientSide,
  + link,
  cache,
  - defaults: {
  + resolvers,
  + typeDefs,
  + })
  +
  + const data = {
  currentRoute: {
  __typename: 'CurrentRoute',
  ...currentRoute,
  @@ -74,38 +128,12 @@ export const initApolloClient = ({
  },
  sharify: {
  __typename: 'Sharify',
  + ...sharifyData,
  },
  - },
  - resolvers: {
  - Cookies: {
  - get: (_obj, args) => cookies[args.name] || null,
  - },
  - Sharify: {
  - get: (_obj, args) => {
  - const value = sharifyData[args.name]
  - return value === undefined ? null : value
  - },
  - },
  - },
  - })
  -
  - const authLink = setContext((_, { headers }) => ({
  - headers: {
  - ...headers,
  - ...(X_AUTH_TOKEN && { 'X-AUTH-TOKEN': X_AUTH_TOKEN }),
  - ...(X_APP_TOKEN && { 'X-APP-TOKEN': X_APP_TOKEN }),
  - ...(X_SHARE_TOKEN && { 'X-SHARE-TOKEN': X_SHARE_TOKEN }),
  - },
  - }))
  -
  - const httpLink = isClientSide ? clientHttpLink : serverHttpLink
  -
  - const link = ApolloLink.from([authLink, stateLink, httpLink])
  + }
  - const client = new ApolloClient({
  - ssrMode: !isClientSide,
  - link,
  - cache,
  + cache.writeData({
  + data,
  })
  if (isClientSide) {
  