Open cmbirk opened 5 years ago
You're in luck! It's something we support today 💪. You can customize the id behavior by passing the entityIdForNode
configuration option when instantiating the cache
Perfect, thanks! I'll open a PR to update the readme with instructions.
Fantastic! Thanks as well
On Wed, Jul 3, 2019, 15:53 Chris Birk notifications@github.com wrote:
Perfect, thanks! I'll open a PR to update the readme with instructions.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/convoyinc/apollo-cache-hermes/issues/418?email_source=notifications&email_token=AAAKDHKO2N5HAJYFFL4QUYTP5UUVJA5CNFSM4H5HVCJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZF36YA#issuecomment-508280672, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAKDHOTDAUK6HOTAJFJPILP5UUVJANCNFSM4H5HVCJA .
why not support dataIdFromObject
so conversion from inmemory is without changes? Isn't it just an alias?
It would be useful for
apollo-cache-hermes
to allow a different cache key other thanid
on a given object. In-memory-cache usesdataIdFromObject
that can be read about in their normalization documentation here: https://www.apollographql.com/docs/react/advanced/caching/#normalizationWe have used that function to determine different cache keys by
__typename
.👋 I would be willing to help implement this feature or document it if it currently exists, but will need some guidance from your team.
I didn't see this on your roadmap, but is this something you would be willing to add?