diff --git a/app/apollo.ts b/app/apollo.ts index 154b089..31a1bc9 100644 --- a/app/apollo.ts +++ b/app/apollo.ts @@ -2,14 +2,11 @@ import { ApolloClient, ApolloLink, HttpLink, InMemoryCache, NormalizedCacheObjec import { clientCache, dataIdFromObject } from 'data/localState'; import { BatchHttpLink } from '@apollo/client/link/batch-http'; -import { SchemaLink } from '@apollo/client/link/schema'; import isEqual from 'lodash/isEqual'; import merge from 'deepmerge'; import { onError } from '@apollo/client/link/error'; -import resolvers from 'data/resolvers'; import schema from 'data/schema'; import { useMemo } from 'react'; -import { makeExecutableSchema } from '@graphql-tools/schema'; export const APOLLO_STATE_PROP_NAME = '__APOLLO_STATE__'; @@ -45,20 +42,7 @@ function createApolloClient(headers?: { [key: string]: string }) { httpLink, // if test is true, debatch batchHttpLink // otherwise, batch ); - - function createIsomorphLink() { - if (typeof window === 'undefined') { - const executableSchema = makeExecutableSchema({ - typeDefs: schema, - resolvers, - }); - return new SchemaLink({ schema: executableSchema }); - } else { - return ApolloLink.from([errorLink, splitLink]); - } - } - - const link = createIsomorphLink(); + const link = ApolloLink.from([errorLink, splitLink]); return new ApolloClient({ ssrMode: typeof window === 'undefined',