You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A cacheKeyFn always returns a key. So whatever you receive through the key param, you can choose a value to turn into a key (string), if not yet a string.
I'd love to second this request, with a specific callout for Typescript examples.
It took me longer than I want to admit to realize that there was a third type available on the DataLoader generic to specify the type for the cache key. The current documentation implies that the return type of the cacheKeyFn is the same type as the key:
If I end up with spare time at the end of this cycle I'll try to pull together a documentation PR, but for the sake of anyone else searching for an answer to this problem, my basic example looks like this:
What problem are you trying to solve?
The api documentation does not show how a different cacheMap or a custom cacheKeyFn should look like, for example if you have a composite keys.
Describe the solution you'd like
Add more examples to the documentation.
The text was updated successfully, but these errors were encountered: