Bulk graphql - retrieve line items only

sachin_kerala
New Member
3 0 0

Bulk GraphQL : While fetching the data for LineItem alone, we have observed that unless we select the Order ID, the data will not be retrieved. However the output comes with two different JSONL object - 1. Order Level, 2. Order Line Level. Can you confirm if there is a way to bring only the LineItem JSONL ?

Below query is showing the error ('userErrors : ', [{u'field': [u'query'], u'message': u"The parent 'node' field for a nested connection must select the 'id' field. Connection fields without 'id': orders."}]). Please advise whether we can retrieve only line items using bulk graphql ?

mutation {
bulkOperationRunQuery(query: """
{
orders {
edges {
node {

lineItems {
edges {
node {
id
}
}
}

}
}
}
}
""") {
bulkOperation {
id
status
}
userErrors {
field
message
}
}
}

Replies 2 (2)
Gregarican
Shopify Partner
1030 86 276

This phenomenon isn't just in regard to bulk operations. It applies to any GQL request. You can test out a test request for the first 10 orders using the GraphiQL shop app. One of the tenants of GQL is that at least the id field must be included for a edges-->node scenario. That's why the GraphiQL shop app will automatically insert the id field if you exclude it in your request.

sachin_kerala
New Member
3 0 0

Thanks for response.Does that mean  there is  no way to bring only the LineItem JSONL using bulk graphql ?