I started to try to build an app with nodejs however using the query the data return has edges { node { I wanted to see if there was a better way to retrive data than using data.products.edge[i].node
I’ve seen the @Shopify_77 /shopify-node-api and I wanted to learn how to use but there is not much documentation
I don’t think that destructuring would improve code readability in this case. In my opinion its benefit is for objects with one single child (like, instead of data.options using { options } would improve readability).
In this particular case I’d suggest doing something like:
const data = data.products.edge[i].node;
Or, even better, renaming data to whatever the actual data is (products, users, etc).
Naming can be difficult sometimes and arguably trivial, but it’s very nice that you have such concern with your code. Keep it up.