Thanks for filing an issue on Apollo Client!
Please make sure that you include the following information to ensure that your issue is actionable.
If you don't follow the template, your issue may end up being closed without anyone looking at it carefully, because it is not actionable for us without the information in this template.
**PLEASE NOTE:** Feature requests and non-bug related discussions are no longer managed in this repo. Feature requests should be opened in https://github.com/apollographql/apollo-feature-requests.
I put this up on StackOverflow, asking if it might be some config issue on our end. No responses.
I'd like cache keys to always be stored in the same pattern. The delta is causing re-renders in our React code. I suspect the real solution is to not depend on the Apollo client (I assume it's a singleton) but some of our code is depending on it and my team will need to get approval to change it. Anyway when I looked at the object in cache this seemed very odd so I'm putting it up as a bug. I could not find any place in our code where these keys are being created.
I might be wrong, this might be our problem. I can't find it though. This object is pretty deep in the Apollo object.
A description of what actually happened, including a screenshot or copy-paste of any related error messages, logs, or other output that might be related. Places to look for information include your browser console, server console, and network logs. Please avoid non-specific phrases like “didn’t work” or “broke”.
Cache keys are `"Account:1107716"` some of the time and `"Account: 1107716"` some of the time.
I can provide the entire object (with circulars taken out) if needed, I'll just have to replace the sensitive info.
Here's what the collapsed object looks like:
**How to reproduce the issue:**
If possible, please create a reproduction using https://github.com/apollographql/react-apollo-error-template and link to it here. If you prefer an in-browser way to create reproduction, try: https://codesandbox.io/s/github/apollographql/react-apollo-error-template
Instructions for how the issue can be reproduced by a maintainer or contributor. Be as specific as possible, and only mention what is necessary to reproduce the bug. If possible, try to isolate the exact circumstances in which the bug occurs and avoid speculation over what the cause might be.
All I can say is that we retrieved some accounts from an endpoint and ran Why Did You Render (a React tool) on the page. WDYR reported that there was a diff between the two cache objects which caused a React component to re-render.
Run the following command in your project directory, and paste its (automatically copied to clipboard) results here:
`npx [email protected]
--preset apollo --clipboard`
OS: macOS 12.5.1
Node: 14.19.1 - ~/.nvm/versions/node/v14.19.1/bin/node
Yarn: 1.22.18 - ~/.nvm/versions/node/v14.19.1/bin/yarn
npm: 6.14.16 - ~/.nvm/versions/node/v14.19.1/bin/npm