File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# ShopifyAPI::GraphQL::Bulk
22
3- Ruby Gem to Bulk import data using the [ Shopify GraphQL Admin Bulk API] ( https://shopify.dev/docs/api/usage/bulk-operations/imports )
3+ Ruby Gem to execute mutations and queries using the [ Shopify GraphQL Admin Bulk API] ( https://shopify.dev/docs/api/usage/bulk-operations/imports )
44
55## Install
66
@@ -18,6 +18,8 @@ gem install "shopify_api-graphql-bulk"
1818
1919## Usage
2020
21+ An [ access token] ( https://shopify.dev/docs/api/usage/authentication#access-tokens-for-the-storefront-api ) is required for the shop.
22+
2123``` rb
2224# Mutation parameters. In this example we're using the productSet mutation.
2325params = [
@@ -41,7 +43,11 @@ params = [
4143]
4244
4345bulk = ShopifyAPI ::GraphQL ::Bulk .new (shop, token)
44- id = bulk.create(" productSet" , params)
46+ id = bulk.mutation(" productSet" , params)
47+
48+ # Or, run a query:
49+ id = bulk.query(your_query)
50+ id = bulk.query(your_query, :group_objects => false )
4551
4652# Wait a bit...
4753
6672` #create ` also accepts a block:
6773
6874``` rb
69- id = bulk.create (" productSet" ) do |args |
75+ id = bulk.mutation (" productSet" ) do |args |
7076 args << input1
7177 args << input2 # etc...
7278end
You can’t perform that action at this time.
0 commit comments