cache problem in apollo v3.0

(property) cache: ApolloCache<unknown>
Type ‘InMemoryCache’ is missing the following properties from type ‘ApolloCache<unknown>’: identify, gc, modify, getFragmentDocts(2739)
ApolloClient.d.ts(21, 5): The expected type comes from property ‘cache’ which is declared here on type ‘ApolloClientOptions<unknown>’

to solve

change

cache

to

cache: new InMemoryCache() as any,

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Responses (1)

Write a response

second way:
import { InMemoryCache } from '@apollo/client/cache';
cache

--