A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
We want to get a list of all ProductVendors for a store. We initially tried using graphql with pagination, but it seems that ProductVendors does not accept the "after" field so we can only fetch the first 250.
As a next step, we're now trying to use a bulk operation to fetch all Product vendors in a single query but the bulk operation is consistently failing. Any idea what's wrong?
Bulk operation to fetch first 250 productVendors. X-request-id: "5e45c5ee-164e-4830-b1dc-7d1ece46e269"
mutation {
bulkOperationRunQuery(
query: """
{
shop {
productVendors(first:250){
edges {
node
}
}
}
}
"""
) {
bulkOperation {
id
status
}
userErrors {
field
message
}
}
}
{"data"=>{"currentBulkOperation"=>{"id"=>"gid://shopify/BulkOperation/1649642733740", "status"=>"RUNNING", "errorCode"=>nil, "createdAt"=>"2022-08-16T14:28:26Z", "completedAt"=>nil, "objectCount"=>"0", "fileSize"=>nil, "url"=>nil, "partialDataUrl"=>nil}},
"extensions"=>{"cost"=>{"requestedQueryCost"=>1, "actualQueryCost"=>1, "throttleStatus"=>{"maximumAvailable"=>2000.0, "currentlyAvailable"=>1008, "restoreRate"=>100.0}}}}
I use this query to check the status
query {
currentBulkOperation {
id
status
errorCode
createdAt
completedAt
objectCount
fileSize
url
partialDataUrl
}
}
for a minute or two after it start, the status is "RUNNING" but then it always fails eventually
Response
{"data"=>{"currentBulkOperation"=>{"id"=>"gid://shopify/BulkOperation/1649642733740", "status"=>"FAILED", "errorCode"=>"INTERNAL_SERVER_ERROR", "createdAt"=>"2022-08-16T14:28:26Z", "completedAt"=>nil, "objectCount"=>"0", "fileSize"=>nil, "url"=>nil, "partialDataUrl"=>nil}}
Any idea why this might be failing?