Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use separator between key fields in cache keys #80

Open
BoD opened this issue Dec 17, 2024 · 0 comments
Open

Use separator between key fields in cache keys #80

BoD opened this issue Dec 17, 2024 · 0 comments

Comments

@BoD
Copy link
Collaborator

BoD commented Dec 17, 2024

Currently, when using multiple key fields, they are concatenated without a separator in the cache key, which can lead to collisions, e.g. with extend type User @typePolicy(keyFields: "firstName lastName") both users ann acorn and anna corn will have the same key User:annacorn.

Let's use + as a separator, and escape it in the values (see discussion).

Note: this is a breaking change - meaning any existing cache keys with more than 1 key field will become invalid after this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant