relay
relay copied to clipboard
MockPayloadGenerator.generateWithDefer returns incorrect `path` for deferred data for list items.
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 Thanks for flagging this bug! I fixed it in this commit. Let me know if you still encounter issues.
Thanks! I will test this out when we can bump our project, closing for now 😄