relay icon indicating copy to clipboard operation
relay copied to clipboard

MockPayloadGenerator.generateWithDefer returns incorrect `path` for deferred data for list items.

Open jakobkhansen opened this issue 2 months ago • 1 comments

Hi,

I am seeing an issue when using MockPayloadGenerator.generateWithDefer to generate deferred data in list items. This happens because the path returned in the responses does not contain the index of the list-item.

Example:

A response returns

["x", "y", "z", "edges", "node"]

which should be

["x", "y", "z", "edges", 0, "node"]

Without this, the deferred data is not correctly read into the relay store and list items don't get deferred data.

Tagging @gorodscy as it seems you implemented generating deferred data in Relay quite recently.

jakobkhansen avatar Apr 18 '24 00:04 jakobkhansen

@jakobkhansen Thanks for flagging this bug! I fixed it in this commit. Let me know if you still encounter issues.

gorodscy avatar May 16 '24 22:05 gorodscy

Thanks! I will test this out when we can bump our project, closing for now 😄

jakobkhansen avatar May 18 '24 08:05 jakobkhansen