Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove session argument from REST examples #1064

Merged
merged 1 commit into from
Nov 16, 2022

Conversation

andyw8
Copy link
Contributor

@andyw8 andyw8 commented Nov 16, 2022

Description

In most cases session can use the default of ShopifyAPI::Context.active_session, so it's not necessary to pass it. This helps to simplify the examples.

@andyw8 andyw8 requested a review from paulomarg November 16, 2022 18:57
@@ -109,10 +109,10 @@ With this, a lot changed in how apps access the library. Here are the updates yo

| Before | After |
| --- | --- |
| `Order.find(:all, params: {param1: value1})` | `Order.all(param1: value1, session:)` |
| `Order.find(<id>)` | `Order.find(id: <id>, session:)` |
| `order = Order.new(<id>)`<br/>`order.post(:close)` | `order = Order.new(session:)`<br/>`order.close()` |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the () from close() since empty arguments are usually omitted in Ruby.

@andyw8 andyw8 marked this pull request as ready for review November 16, 2022 21:48
@andyw8 andyw8 merged commit 27ab629 into main Nov 16, 2022
@andyw8 andyw8 deleted the andyw8/remove-session-argument branch November 16, 2022 21:49
kaarelss added a commit to kaarelss/shopify-api-ruby that referenced this pull request Nov 29, 2022
…y-api-ruby into response_in_error_object

* 'response_in_error_object' of github.com:kaarelss/shopify-api-ruby:
  Added assertion that response is present in MaxHttpRetriesExceededError
  Added sorbet assertion
  Removed extra empty line
  ShopifyAPI::Clients::HttpResponse as argument for ShopifyAPI::Errors::HttpResponseError because code can be obtained from response as well as headers for custom retry logic
  Remove mentions of private apps (Shopify#1062)
  Fix ActiveSupport inflector dependency (Shopify#1063)
  Move Session Storage to `shopify_app` (Shopify#1055)
  Remove session argument from REST examples (Shopify#1064)
  Constrain Zeitwerk to 2.6.5 (Shopify#1059)
  Clarify statement about packages (Shopify#1057)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants