# currentBulkOperation - admin-graphql - QUERY Version: 2024-10 ## 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. ### Access Scopes ## Arguments * [type](/docs/api/admin-graphql/2024-10/enums/BulkOperationType): BulkOperationType - The current bulk operation's type. ## Returns * [completedAt](/docs/api/admin-graphql/2024-10/scalars/DateTime): DateTime When the bulk operation was successfully completed. * [createdAt](/docs/api/admin-graphql/2024-10/scalars/DateTime): DateTime! When the bulk operation was created. * [errorCode](/docs/api/admin-graphql/2024-10/enums/BulkOperationErrorCode): BulkOperationErrorCode Error code for failed operations. * [fileSize](/docs/api/admin-graphql/2024-10/scalars/UnsignedInt64): UnsignedInt64 File size in bytes of the file in the `url` field. * [id](/docs/api/admin-graphql/2024-10/scalars/ID): ID! A globally-unique ID. * [objectCount](/docs/api/admin-graphql/2024-10/scalars/UnsignedInt64): UnsignedInt64! A running count of all the objects processed. For example, when fetching all the products and their variants, this field counts both products and variants. This field can be used to track operation progress. * [partialDataUrl](/docs/api/admin-graphql/2024-10/scalars/URL): URL The URL that points to the partial or incomplete response data (in [JSONL](http://jsonlines.org/) format) that was returned by a failed operation. The URL expires 7 days after the operation fails. Returns `null` when there's no data available. * [query](/docs/api/admin-graphql/2024-10/scalars/String): String! GraphQL query document specified in `bulkOperationRunQuery`. * [rootObjectCount](/docs/api/admin-graphql/2024-10/scalars/UnsignedInt64): UnsignedInt64! A running count of all the objects that are processed at the root of the query. For example, when fetching all the products and their variants, this field only counts products. This field can be used to track operation progress. * [status](/docs/api/admin-graphql/2024-10/enums/BulkOperationStatus): BulkOperationStatus! Status of the bulk operation. * [type](/docs/api/admin-graphql/2024-10/enums/BulkOperationType): BulkOperationType! The bulk operation's type. * [url](/docs/api/admin-graphql/2024-10/scalars/URL): URL The URL that points to the response data in [JSONL](http://jsonlines.org/) format. The URL expires 7 days after the operation completes. ## Examples ### Get the currentBulkOperation for a query Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { currentBulkOperation(type: QUERY) { id type status } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n currentBulkOperation(type: QUERY) {\n id\n type\n status\n }\n }`,\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query {\n currentBulkOperation(type: QUERY) {\n id\n type\n status\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n currentBulkOperation(type: QUERY) {\n id\n type\n status\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n currentBulkOperation(type: QUERY) {\n id\n type\n status\n }\n}" #### Graphql Input null #### Graphql Response { "data": { "currentBulkOperation": { "id": "gid://shopify/BulkOperation/726270413", "type": "QUERY", "status": "CREATED" } } }