I’m trying to configure InMemoryCache
so that ROOT_QUERY
has the same key whether a variable is null
or undefined
(or not passed at all, but that seems to be the same as undefined
).
I’ve tried to use typePolicies
:
const cache = new InMemoryCache({
typePolicies: {
Query: {
keyFields: (object, context) => ...
}
}
});
but when logging this function never seems to be called. RootQuery
or ROOT_QUERY
instead of Query
don’t work either.
Is this possible? Or would I need to subclass InMemoryCache
instead?