How to fetch things nested in an HTTP graphQL request

Hello,

I’m very new to make - and I’m trying to create a flow that fetches stock levels from a warehouse - and updates them on Shopify.

To explain the flow, I fetch SKUs and quantities from the Warehouse with an HTTP request, then I use another HTTP request with a graphQL query to get the inventory items :

{
productVariants(first: 5, query: “sku:{{14.attributes.sku}}”) {
nodes {
inventoryItem {
id
}
}
}
}

The problem is for business reasons 1 sku and have many inventory items, so I need to iterate again but I can’t see the inventory items in the next modules.

I might be doing something stupid as I’m new to this - could someone help out ?
Thanks so much in advance. (Screenshots of the modules attached)


Hello - it seems the answer may be here : API call output not parsed entirely - #3 by mszymkowiak

I will check this and update the post if it works :slight_smile:

Edit : I have checked and I was unable to implement the solution that was described.

Regards,

Welcome to the Make community!

Paste this in an iterator module.

e.g.: (paste this into the field)

{{ map(9.data.data.productVariants.nodes; "inventoryItem.id") }}

“Looping” Through Array Items

When you see an ARRAY, think ITERATOR module.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

4 Likes

Hello Sam,

I still need to test the entire flow here - but this indeed fetches me the information I need ! I was using an iterator yet the information wasn’t natively “selectable” and I don’t know enough about the mapping logic yet. I will learn from this example.

Thank you so much, have a nice day !

1 Like