Steps to reproduce
Cannot read property '0' of nullGIF:

Code:
import gql from "graphql-tag";
import { initClient, dedupExchange, fetchExchange } from "@urql/svelte";
import { offlineExchange } from "@urql/exchange-graphcache";
import { makeDefaultStorage } from "@urql/exchange-graphcache/default-storage";
import { TODOS_QUERY, TODO_FRAG } from "./gql";
const updates = {
Mutation: {
addTodo: (result, args, cache, info) => {
const allFields = cache.inspectFields("Query");
const todoQueries = allFields.filter(x => x.fieldName === "todos");
todoQueries.forEach(x => {
cache.updateQuery(
{ query: TODOS_QUERY, variables: x.arguments },
data => {
return {
...data,
todos: [...data.todos, result.addTodo]
};
}
);
});
}
}
};
const optimistic = {
addTodo: (variables, cache, info) => {
return {
...variables,
__typename: "Todo",
id: "TEMP_ID_" + Date.now(),
complete: false,
createdAt: Date.now()
};
}
};
const storage = makeDefaultStorage({
idbName: "graphcache-v3",
maxAge: 7
});
const exchanges = [
dedupExchange,
offlineExchange({ storage, updates, optimistic }),
fetchExchange
];
function OnInit() {
initClient({ url: "https://h1pcl.sse.codesandbox.io", exchanges });
}
export default {
OnInit
};
I thought it was due to this: https://spectrum.chat/urql/help/is-there-a-way-to-invalidate-queries-with-variables-without-using-variables~5e4fc1b8-849e-46e9-a9ca-72698a8433d0?m=MTU4NTkyMDE5ODMwOA==.
But it's happening also with cache.invalidate for the deleteTodo resolver:
deleteTodo: (result, args, cache, info) => {
if (result.deleteTodo) {
cache.invalidate({ __typename: "Todo", id: args.id });
}
}
Here the gif for deleteTodo with cache.invalidate().

Yea, I found the issue. I think it鈥檚 a bug with our default storage, so I鈥檒l have to take another look at it.
Most helpful comment
Yea, I found the issue. I think it鈥檚 a bug with our default storage, so I鈥檒l have to take another look at it.