Я пытаюсь напрямую записать данные в кеш apollo с помощью следующей команды:
client.writeQuery(
{ query: GET_MOVIES },
{ data: { movies: response.data.results } }
);
response.data.results :
[{id:1, title:'title', ...}, ...]
const GET_MOVIES = gql`
query myQuery {
movies @client {
id
}
}
`;
и выдается следующая ошибка:
Error: Error writing result to store for query:
Cannot read property 'movies' of undefined
TypeError: Cannot read property 'movies' of undefined