- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
try {
try {
const { todos } = cache.readQuery({ query: GET_TODOS })
cache.writeQuery({
query: GET_TODOS,
data: { todos: todos.filter(todo => todo.id !== deleteTodo.id) }
})
} catch {
console.log()
}
const { category } = cache.readQuery({ query: GET_TODOS_BY_CATEGORY, variables: { id: deleteTodo.category.id } })
cache.writeQuery({
query: GET_TODOS_BY_CATEGORY,
variables: { id: deleteTodo.category.id },
data: { category: { title: category.title, todos: category.todos.filter(todo => todo.id !== deleteTodo.id), __typename: 'Category' } }
})
} catch {
return null
}
guest # 0
const, новомодная фигня, а все равно лесенка траев