Anchor to currentBulkOperationcurrent
currentBulkOperation
query
Returns the current app's most recent BulkOperation. Apps can run one bulk query and one bulk mutation operation at a time, by shop.
Anchor to Arguments
Arguments
- Anchor to typetype•Bulk
Operation Default:QUERYType The current bulk operation's type.
Was this section helpful?
Anchor to Possible returnsPossible returns
- Anchor to BulkOperationBulk•
Operation An asynchronous long-running operation to fetch data in bulk or to bulk import data.
Bulk operations are created using the
or
mutation. After they are created, clients should poll the
status
field for updates. When, the
url
field contains a link to the data in JSONL format.Refer to the bulk operations guide for more details.
Was this section helpful?
Get the currentBulkOperation for a query
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
currentBulkOperation(type: QUERY) {
id
type
status
}
}`,
);
const data = await response.json();
query {
currentBulkOperation(type: QUERY) {
id
type
status
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query { currentBulkOperation(type: QUERY) { id type status } }"
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
currentBulkOperation(type: QUERY) {
id
type
status
}
}`,
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: `query {
currentBulkOperation(type: QUERY) {
id
type
status
}
}`,
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
query {
currentBulkOperation(type: QUERY) {
id
type
status
}
}
QUERY
response = client.query(query: query)
Response
JSON{
"currentBulkOperation": {
"id": "gid://shopify/BulkOperation/726270413",
"type": "QUERY",
"status": "CREATED"
}
}