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

Add support Collection#products endpoint #609

Merged
merged 4 commits into from
Sep 3, 2019
Merged

Conversation

siddhantbajaj
Copy link
Contributor

@siddhantbajaj siddhantbajaj commented Aug 27, 2019

We are introducing a new endpoint which allow merchants to query for products for a particular collection without knowing its type.This PR adds support for this new endpoint in the shopify api gem.

NOTE: We currently have this change behind unstable. I will create another PR to replace unstable with specific version these changes will go in.

What should reviewers focus on?

  1. Try using the local version of the gem.
  2. ShopifyAPI::Collection.find(2).products this should return the products of the collection.

Note: This PR is safe to rollback as the new endpoint is behind a version change which will probably be introduced in 2019/10 version.

@siddhantbajaj siddhantbajaj requested a review from a team as a code owner August 27, 2019 18:43
@tanema
Copy link
Contributor

tanema commented Aug 27, 2019

Hey @siddhantbajaj I think this will have to wait until we have merged #600 so that we can appropriately manage the version which will support this. I will get back to you soon.

@siddhantbajaj
Copy link
Contributor Author

Currently blocked by the ^^ PR, but I can use some code reviews till then. :-)

@AlexAxeman
Copy link
Contributor

I think you also need to add an api-test. Will this be a new entry in the API docs? It's neither a method in SmartCollections, neither in CustomCollections so you might need to add it.

@siddhantbajaj
Copy link
Contributor Author

Yes, I already have a PR up for it - https://github.com/Shopify/shopify/pull/213687. Just added you for the review there as well.

@siddhantbajaj siddhantbajaj requested a review from tanema September 3, 2019 17:15
extension: false
)

assert_raises NotImplementedError do
Copy link
Contributor

Choose a reason for hiding this comment

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

Weird.. I would have expected this to be a 404.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't really have a strong opinion here, just something we are following in other parts of the project as well, where version is incorrect.


collection = ShopifyAPI::Collection.find(1)

fake(
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be here if the call is going to fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we can remove this. 👍

Copy link
Contributor

@AlexAxeman AlexAxeman left a comment

Choose a reason for hiding this comment

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

Just a few questions, otherwise seems good to me!


module ShopifyAPI
class Collection < Base
include Events
Copy link
Member

Choose a reason for hiding this comment

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

do we need to include Events?

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 think yes, we do need to keep support for Events. We will also have to create PR in Shopify/shopify to add support for Collection.events.

@siddhantbajaj siddhantbajaj merged commit 8905f90 into master Sep 3, 2019
@jtgrenz jtgrenz temporarily deployed to rubygems September 5, 2019 14:13 Inactive
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.

5 participants