flattenConnection
The flattenConnection
utility transforms a connection object from the Storefront API (for example, Product-related connections) into a flat array of nodes. The utility works with either nodes
or edges.node
.
Example code
Anchor link to section titled "Example code"
Argument | Required |
---|---|
A connection object with the field nodes or edges . For example, any of the Product connections. |
Yes |
Return type
Anchor link to section titled "Return type"A flat array that contains elements that correspond to the node
value in each element of the original edges
array, or the node
itself.