Skip to content

Commit

Permalink
Update changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Feb 6, 2025
1 parent f438fb0 commit 1665f8a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .changeset/pretty-planets-cough.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"@apollo/client": minor
---

Provide a more type-safe option for `observableQuery.updateQuery` which types the value of previous data incorrectly which could result in crashes at runtime. The `updateQuery` callback function is now called with a new type-safe `previousData` property and a `complete` property in the 2nd argument that determines whether `previousData` is a complete or partial result.
Provide a more type-safe option for the previous data value passed to `observableQuery.updateQuery`. Using it could result in crashes at runtime as this callback could be called with partial data even though its type reported the value as a complete result.

The `updateQuery` callback function is now called with a new type-safe `previousData` property and a new `complete` property in the 2nd argument that determines whether `previousData` is a complete or partial result.

As a result of this change, it is recommended to use the `previousData` property passed to the 2nd argument of the callback rather than using the previous data value from the first argument since that value is not type-safe. The first argument is now deprecated and will be removed in a future version of Apollo Client.

Expand Down

0 comments on commit 1665f8a

Please sign in to comment.