Warehouse_products inside products query penalized too high

Hi Guys,

We’re asking for products in GraphQL API, that query must include warehouse_products field, but it is getting to expensive adding this field. Next query penalize with 1 every product node in query:

query{
products{
complexity,
request_id,
data(first:10){
pageInfo{
hasNextPage,
startCursor,
endCursor,
}
edges{
node{
id,
created_at,
updated_at,
legacy_id,
name,
sku,
barcode,
}
}
}
}
}

But if we add warehouse_products, the API is going to penalize with 30 points every product in query, like this:

query{
products{
complexity,
request_id,
data(first:10){
pageInfo{
hasNextPage,
startCursor,
endCursor,
}
edges{
node{
id,
created_at,
updated_at,
legacy_id,
name,
sku,
barcode,
warehouse_products{
inventory_bin,
available
}
}
}
}
}
}

Why is it too expensive to add warehouse_products field in query?
How can we minimize the penalization for a query like that?

Hello @maomuriel the query cost is due the field available which is an expensive calculation which costs 30 credits.

1 Like