Skip to content

Commit

Permalink
Add blurb for generic HttpClient
Browse files Browse the repository at this point in the history
  • Loading branch information
zzooeeyy committed Sep 11, 2023
1 parent 01d9ba8 commit 722017c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion BREAKING_CHANGES_FOR_V10.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ SHOP_NAME_QUERY = client.parse <<-'GRAPHQL'
GRAPHQL

result = client.query(SHOP_NAME_QUERY)
result.data.shop.name
shop_name = result.data.shop.name
```

ShopifyAPI Client v10+
Expand All @@ -137,6 +137,7 @@ SHOP_NAME_QUERY =<<~QUERY
QUERY

response = client.query(query: query)
shop_name = response.body["data"]["shop"]["name"]
```

#### REST
Expand Down Expand Up @@ -179,3 +180,9 @@ body = {
client.put(path: "products/<id>.json", body: body)
```

#### Generic HTTP Client
We added a new generic [HttpClient](https://github.com/Shopify/shopify-api-ruby/blob/main/lib/shopify_api/clients/http_client.rb) wrapper to make requests and handle Shopify specific errors. All of the REST and GraphQL Clients use this HTTP Client in its foundation.
You can use this to make direct HTTP API calls easily.
See how the GraphQL Client makes a request with this HttpClient class in its [implementation here](https://github.com/Shopify/shopify-api-ruby/blob/main/lib/shopify_api/clients/graphql/client.rb#L33-L45).


0 comments on commit 722017c

Please sign in to comment.