Skip to content

Commit dc3095f

Browse files
committed
README updates
1 parent b1ab08d commit dc3095f

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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.
2325
params = [
@@ -41,7 +43,11 @@ params = [
4143
]
4244

4345
bulk = 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

@@ -66,7 +72,7 @@ end
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...
7278
end

0 commit comments

Comments
 (0)