--- title: currentBulkOperation - GraphQL Admin description: Returns the current app's most recent BulkOperation. Apps can run one bulk query and one bulk mutation operation at a time, by shop. api_version: 2025-10 api_name: admin type: query api_type: graphql source_url: html: https://shopify.dev/docs/api/admin-graphql/latest/queries/currentbulkoperation md: https://shopify.dev/docs/api/admin-graphql/latest/queries/currentbulkoperation.md --- # current​Bulk​Operation 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. ## Arguments * type [Bulk​Operation​Type](https://shopify.dev/docs/api/admin-graphql/latest/enums/BulkOperationType) Default:QUERY The current bulk operation's type. *** ## Possible returns * Bulk​Operation [Bulk​Operation](https://shopify.dev/docs/api/admin-graphql/latest/objects/BulkOperation) An asynchronous long-running operation to fetch data in bulk or to bulk import data. Bulk operations are created using the `bulkOperationRunQuery` or `bulkOperationRunMutation` mutation. After they are created, clients should poll the `status` field for updates. When `COMPLETED`, the `url` field contains a link to the data in [JSONL](http://jsonlines.org/) format. Refer to the [bulk operations guide](https://shopify.dev/api/usage/bulk-operations/imports) for more details. *** ## Examples * ### Get the currentBulkOperation for a query #### Description The following query retrieves the currentBulkOperation for a query. #### Query ```graphql query { currentBulkOperation(type: QUERY) { id type status } } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query { currentBulkOperation(type: QUERY) { id type status } }" }' ``` #### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query { currentBulkOperation(type: QUERY) { id type status } }`, ); const json = await response.json(); return json.data; } ``` #### Ruby ```ruby 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) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: `query { currentBulkOperation(type: QUERY) { id type status } }`, }); ``` #### Response ```json { "currentBulkOperation": { "id": "gid://shopify/BulkOperation/726270413", "type": "QUERY", "status": "CREATED" } } ``` ## Get the currentBulkOperation for a query [Open in GraphiQL](http://localhost:3457/graphiql?query=query%20%7B%0A%20%20currentBulkOperation\(type%3A%20QUERY\)%20%7B%0A%20%20%20%20id%0A%20%20%20%20type%0A%20%20%20%20status%0A%20%20%7D%0A%7D) ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query { currentBulkOperation(type: QUERY) { id type status } }`, ); const json = await response.json(); return json.data; } ``` ##### GQL ``` query { currentBulkOperation(type: QUERY) { id type status } } ``` ##### cURL ``` curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query { currentBulkOperation(type: QUERY) { id type status } }" }' ``` ##### React Router ``` import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query { currentBulkOperation(type: QUERY) { id type status } }`, ); const json = await response.json(); return json.data; } ``` ##### Node.js ``` const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: `query { currentBulkOperation(type: QUERY) { id type status } }`, }); ``` ##### Ruby ``` 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 ```json { "currentBulkOperation": { "id": "gid://shopify/BulkOperation/726270413", "type": "QUERY", "status": "CREATED" } } ```