Store error: the application attempted to write an object with no provided id but the store already contains an id of Hogehoge for this object.
Apollo Clientで、以下のようなqueryによって取得/キャッシュされたnoteオブジェクトがあったとして
query notes {
notes {
id
content
author {
id
name
}
}
}
キャッシュされているnoteオブジェクトを更新するようなmutationのフィールドが以下のようになっていた場合
mutation updateNote($input: UpdateNoteInput!) {
updateNote(input: $input) {
id
content
author {
name
}
}
}
authorにidがないため、見出しのようなエラーが出る。
ちなみに以下のようなフィールドにするとエラーは出ないがエンティティを特定できないため当然キャッシュは更新されない。
mutation updateNote($input: UpdateNoteInput!) {
updateNote(input: $input) {
content
author {
id
name
}
}
}