You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This allows for using [the Storefront private access token][1] with the
library's Storefront GraphQL client. Since this client is probably going
to be running on a server where the token can be secured, using the
private access token should be preferred. This commit doesn't make using
the private token the default to avoid an immediate breaking change. We
want to give clients time to see the deprecation and update their
scripts.
Closes#1293
[1]: https://shopify.dev/docs/api/usage/authentication#getting-started-with-private-access
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,8 @@ Note: For changes to the API, see https://shopify.dev/changelog?filter=api
7
7
-[#1071](https://github.com/Shopify/shopify-api-ruby/issues/1071) Fix FulfillmentEvent class types
8
8
- Fix: InventoryItem class `harmonized_system_code` attribute type which can be either integer, string or nil
9
9
- Fix: Variant class `inventory_quantity` attribute type which can be either integer, string or nil
10
+
-[1293](https://github.com/Shopify/shopify-api-ruby/issues/1293) Add support for using Storefront private access tokens.
11
+
- Deprecated passing the public Storefront access token as a positional parameter to the Storefront GraphQL client in favor of using the named parameter. (You probably want to use the private access token for this client anyway.)
10
12
11
13
## 14.0.1
12
14
-[#1288](https://github.com/Shopify/shopify-api-ruby/pull/1288) Fix FeatureDeprecatedError being raised without a message.
Copy file name to clipboardExpand all lines: docs/usage/graphql_storefront.md
+13-6Lines changed: 13 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,21 @@
1
1
# Make a Storefront API call
2
2
3
-
The library also allows you to send GraphQL requests to the [Shopify Storefront API](https://shopify.dev/docs/api/storefront). To do that, you can use `ShopifyAPI::Clients::Graphql::Storefront` with the current session and a `storefrontAccessToken`.
3
+
The library also allows you to send GraphQL requests to the [Shopify Storefront API](https://shopify.dev/docs/api/storefront). To do that, you can use `ShopifyAPI::Clients::Graphql::Storefront` with either a [private or public Storefront access token](https://shopify.dev/docs/api/usage/authentication#access-tokens-for-the-storefront-api).
4
4
5
5
You can obtain Storefront API access tokens for both private apps and sales channels. Please read [our documentation](https://shopify.dev/docs/custom-storefronts/building-with-the-storefront-api/getting-started) to learn more about Storefront Access Tokens.
6
6
7
7
Below is an example of how you may query the Storefront API:
8
8
9
9
```ruby
10
10
# Load the access token as per instructions above
11
-
storefront_access_token=''
11
+
storefront_private_access_token=''
12
12
# your shop domain
13
13
shop_url ='shop.myshopify.com'
14
14
15
-
# initialize the client with session and storefront access token
By default, the client uses the API version configured in `ShopifyAPI`. To use a different API version, set the optional `api_version` parameter. To experiment with prerelease API features, use `"unstable"` for the API version.
0 commit comments