Development discussions around Shopify APIs
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
}
}
}
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.
Thanks for response.Does that mean there is no way to bring only the LineItem JSONL using bulk graphql ?
Photo by Marco Verch Sales channels on Shopify are various platforms where you can sell...
By Ollie May 25, 2023Summary of EventsBeginning in January of 2023, some merchants reported seeing a large amo...
By Trevor May 15, 2023With 2-Factor Authentication being required to use Shopify Payments, we’re here to help yo...
By Imogen Apr 26, 2023