From dc1eb75d8606c0ac50139091fc64cb065e788021 Mon Sep 17 00:00:00 2001 From: Eric Walker Date: Mon, 23 Jan 2023 12:59:28 -0500 Subject: [PATCH] Add docs examples --- docs/usage/graphql.md | 6 ++++++ docs/usage/graphql_storefront.md | 6 ++++++ docs/usage/rest.md | 7 +++++++ 3 files changed, 19 insertions(+) diff --git a/docs/usage/graphql.md b/docs/usage/graphql.md index ccd3188ca..2555417fe 100644 --- a/docs/usage/graphql.md +++ b/docs/usage/graphql.md @@ -88,6 +88,12 @@ response = client.query(query: query, variables: variables) # do something with the reponse ``` +To experiment with prerelease features, pass the api_version unstable when initializing the client. + +```ruby +client = ShopifyAPI::Clients::Graphql::Admin.new(session: session, api_version: "unstable") +``` + Want to make calls to the Storefront API? Click [here](graphql_storefront.md) # Proxy a GraphQL Query diff --git a/docs/usage/graphql_storefront.md b/docs/usage/graphql_storefront.md index 1bc9631f6..e7eacee03 100644 --- a/docs/usage/graphql_storefront.md +++ b/docs/usage/graphql_storefront.md @@ -39,4 +39,10 @@ response = client.query(query: query) # do something with the returned data ``` +To experiment with prerelease features, pass the api_version unstable when initializing the client. + +```ruby +client = ShopifyAPI::Clients::Graphql::Storefront.new(shop_url, storefront_access_token, api_version: "unstable") +``` + Want to make calls to the Admin API? Click [here](graphql.md) diff --git a/docs/usage/rest.md b/docs/usage/rest.md index 7a98877d8..6a1b823f5 100644 --- a/docs/usage/rest.md +++ b/docs/usage/rest.md @@ -62,6 +62,13 @@ client.post({ _for more information on the `products` endpoint, [check out our API reference guide](https://shopify.dev/api/admin-rest/unstable/resources/product)._ +### Override the `api_version`: + +```ruby +# To experiment with prerelease features, pass the api_version "unstable". +client = ShopifyAPI::Clients::Rest::Admin.new(session: session, api_version: "unstable") +``` + ## Pagination This library also supports cursor-based pagination for REST Admin API requests. [Learn more about REST request pagination](https://shopify.dev/api/usage/pagination-rest).