Skip to content

Commit

Permalink
Create a new object for console to have a prototype with toString met…
Browse files Browse the repository at this point in the history
…hod (#11834)

* Create a new object to have a prototype

Objects possibly can have null prototypes. This causes them not to have
toString() method leading to an error when doing substitution with
console.warn().
  • Loading branch information
psamim authored May 6, 2024
1 parent 723784b commit 7d8aad4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/rich-geese-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/client": patch
---

Fix error "Cannot convert object to primitive value"
4 changes: 2 additions & 2 deletions src/cache/inmemory/writeToStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ For more information about these options, please refer to the documentation:
" have an ID or a custom merge function, or "
: "",
typeDotName,
existing,
incoming
{ ...existing },
{ ...incoming }
);
}

0 comments on commit 7d8aad4

Please sign in to comment.