Implement complete Bulk Operations support for Shopify Admin API#23
Draft
Implement complete Bulk Operations support for Shopify Admin API#23
Conversation
Author
|
@mtylty 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs. I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review. |
Co-authored-by: mtylty <167670+mtylty@users.noreply.github.com>
…ests Co-authored-by: mtylty <167670+mtylty@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement Bulk Operations support (Shopify Admin API)
Implement complete Bulk Operations support for Shopify Admin API
Aug 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements comprehensive Bulk Operations support for the Shopify Admin API, enabling asynchronous processing of large GraphQL queries and mutations without rate limiting concerns.
Key Features Added
Ruby Module API
ShopifyToolkit::BulkOperationsmodule with complete functionality:run_bulk_query(query, group_objects: false)- Submit bulk GraphQL queriesrun_bulk_mutation(mutation, variables_data, ...)- Submit bulk mutations with automatic staged uploadscurrent_bulk_operation(type: nil)- Check operation statuscancel_bulk_operation(operation_id)- Cancel running operationsdownload_results(operation_or_url, parse_results: true)- Download and parse JSONL resultspoll_until_complete(operation_id, ...)- Poll with progress callbacksCLI Commands
Five new Thor commands integrated into existing CLI:
shopify-toolkit bulk_query QUERY_FILE- Submit bulk queriesshopify-toolkit bulk_mutation MUTATION_FILE VARIABLES_FILE- Submit bulk mutationsshopify-toolkit bulk_status [OPERATION_ID]- Check operation statusshopify-toolkit bulk_cancel OPERATION_ID- Cancel operationsshopify-toolkit bulk_results OPERATION_ID_OR_URL- Download resultsAdvanced Features
stagedUploadsCreateBulkOperationError- General bulk operation errorsOperationInProgressError- When attempting to start while another operation runsExample Usage
# CLI usage shopify-toolkit bulk_query examples/products.graphql --poll --output results.json shopify-toolkit bulk_mutation examples/create_products.graphql examples/variables.jsonImplementation Details
AdminClientmodule and Thor CLI infrastructureThe implementation supports all bulk operation workflows described in the Shopify documentation, including proper handling of JSONL formats, staged uploads for mutations, and webhook-style polling for completion status.
Fixes #22.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.