From 0770e3aaa4a4fc09ef626b7fb1332a331b4177d8 Mon Sep 17 00:00:00 2001 From: ymc9 <104139426+ymc9@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:19:03 -0700 Subject: [PATCH] doc: update optimistic update behavior for "upsert" --- docs/reference/plugins/_optimistic-behavior.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/reference/plugins/_optimistic-behavior.md b/docs/reference/plugins/_optimistic-behavior.md index 32463b03..6c54ff85 100644 --- a/docs/reference/plugins/_optimistic-behavior.md +++ b/docs/reference/plugins/_optimistic-behavior.md @@ -1,3 +1,4 @@ - `create` mutation inserts item to the head of the query results of the corresponding `useFindMany` queries. - `update` mutation updates the item in the query results of `useFindXXX` queries and their nested reads by matching the item's ID. +- `upsert` mutation first tries to update the item in the query results of `useFindXXX` queries and their nested reads by matching the item's ID. If the item is not found, it inserts the item to the head of the query results. - `delete` mutation removes the item from the query results of the corresponding `useFindMany` queries and sets `null` to `useFindUnique` and `useFindFirst` query results, by matching the item's ID.