When destructuring the the included object from the call to get all products we need to defend against cases where none of the retrieved products have a main_image relationship. In those instances we're unable to destrcuture from an undefined object (included).
TypeError: Cannot destructure propertymain_imagesof 'undefined' or 'null'.
When destructuring the the
included
object from the call to get all products we need to defend against cases where none of the retrieved products have amain_image
relationship. In those instances we're unable to destrcuture from an undefined object (included
).TypeError: Cannot destructure property
main_imagesof 'undefined' or 'null'.
https://github.com/moltin/gatsby-source-moltin/blob/4b34775e6a59b4a513c1eb7c5100c412780acb4c/gatsby-node.js#L125-L128