daffodil icon indicating copy to clipboard operation
daffodil copied to clipboard

[BUG] Customer subfield requests are not safely merged into apollo cache in Magento driver

Open griest024 opened this issue 3 years ago • 1 comments

:bug: Bug report

Current Behavior

When requesting customer subfields (addresses, orders, etc.) the resulting objects are not merged into apollo cache

Expected Behavior

Query results of the same entity are merged into cache. Should request customer ID on every query

What is the motivation / use case for changing the behavior?

better caching

griest024 avatar Feb 20 '23 16:02 griest024

To include the customer ID in every query, you can either pass it as a variable or include it in the query itself. This ensures that the customer ID is always present and that the correct data is retrieved from the cache.

you can try implementing a custom merge function that handles these subfields and ensures that they are properly merged into the cache. Another option is to use the readFragment method to read the data directly from the cache and manually merge the subfields into the existing data.

shadow0500 avatar Jun 07 '23 05:06 shadow0500