shopify icon indicating copy to clipboard operation
shopify copied to clipboard

Shopify.Pagination module

Open balexand opened this issue 5 years ago • 11 comments

Fixes #83. See the doc comments in the Shopify.Pagination module for details and examples.

balexand avatar Dec 18 '19 23:12 balexand

It's possible that the :middleware option can be removed in order to simplify things. A custom adapter could be used to throttle requests instead. Please let me know if you have any preferences. Happy new year!

balexand avatar Jan 01 '20 20:01 balexand

Thanks @balexand for your contribution. @nsweeting any chance you have some feedback on this for us all? Shopify will remove for page based navigation in less than a month now: April 1st. Thank you both!

larskluge avatar Mar 06 '20 05:03 larskluge

Let me know if there's anything that I can do to help. I'm currently using the code from this PR in production and it works great.

balexand avatar Mar 06 '20 22:03 balexand

@balexand since this doesn't seem to be getting merged in I've been using your fork. I wonder if it might be worthwhile to publish a new hex package. There's still plenty of stuff that could be added, I noticed some missing fields on some resources, and there's some deprecation issues with updating products due to the inventory fields. Those should probably be removed or at least handled better for updating products.

For now I've just been dumping it to a map and removing the offending keys so shopify accepts it

ProtoJazz avatar May 28 '20 17:05 ProtoJazz

@ProtoJazz @balexand I am a maintainer in this project, and I have to apologize for the lack of attention we have been spending on this library.

Truth is (only speaking for myself here, @nsweeting might have a different oppinion) that the initial approach of having structs for each resource has lost a lot of viability since Shopify started to update their API almost every 4 months. You would also have to keep updating a library of older structs, that are still compatible with older versions, making the library kind of bulky and hard to understand for its use cases.

Ever since Shopify started using versioned REST API, we have largely switched to using their GraphQL API, and I am seeing the same problems there: If you want to use any Shopify API, you better be ready to fully commit to being a Shopify developer, because they are cranking out new features and deprecations in a pace that I find disturbing. My personal opinion is that Shopify probably thinks of Shopify-App developers as basically their employees, and we have to keep up with what they dictate, but I think they are just violating the basic idea of what an API is: A lasting contract between consumer and supplier.

I would like to contribute more, but I simply can not. There is no time management in the world that could give me the freedom to give you guys the attention you deserve.

I spent days basically going through Shopify's REST API documentation and implementing the missing resources, trying to accommodate for their ideas in how a REST API works, coming up with half backed solutions to how we could solve it. I learned a lot, it was my entry into Elixir open-source and I would not want to miss it - but I certainly do not want (or can afford) to spend the rest of my developer life chasing Shopify's new inventions.

@nsweeting by all means, I think it is time to pass the torch, find other maintainers or maybe transfer the whole project.

Ninigi avatar May 29 '20 13:05 Ninigi

Yeah, I suspect as shopify grows they're finding certain parts of their API just not sustainable at scale. They just grow at such a crazy pace.

Thankfully after the change to the versioned api, at least theres some warning about changes and time to fix it

I wouldn't be opposed to helping as a maintainer. I'm still pretty new to elixir, but I've been working with shopify everyday for the last few years and don't see any signs of stopping any time soon

ProtoJazz avatar May 29 '20 14:05 ProtoJazz

Hi @Ninigi. Thanks for your response.

I can definitely relate to your difficulties with the Shopify API. It has lots of quirks and inconsistencies and they do make breaking changes at an alarming rate. I work with the Shopify API constantly at my current job so I really hope things stabilize.

I would prefer to become a regular contributor to this project as opposed to completely taking it over. This could mean giving me access to merge pull-requests in the Github repo. Or it could mean that you would recognize me as a trusted contributor and be willing to merge my pull-requests with less review. In either case, I would consult with the other project members before making any significant changes.

@Ninigi and @nsweeting, would you be interested in having me become a more regular contributor? Also, I'm curious to know how involved you both are interested in being with this project. We can discuss here or I can do a Zoom call if that works better for you.

balexand avatar May 29 '20 15:05 balexand

What do you think of removing the middleware option? It complicates the API a bit and I've since moved towards using a custom adapter to throttle requests in my app. Here's the description of the middleware option:

https://github.com/nsweeting/shopify/blob/bd6884d89578efeaf65a41680e538fe9214a287f/lib/shopify/pagination.ex#L31-L35

balexand avatar May 29 '20 16:05 balexand

@balexand @ProtoJazz Can't find the documentation to use the change. Can you help me?

hashim-sohail avatar Jun 24 '20 11:06 hashim-sohail

@balexand @ProtoJazz Can't find the documentation to use the change. Can you help me?

It hasn't been merged in. You could point at the fork this PR is based on in your mix file https://hexdocs.pm/mix/Mix.Tasks.Deps.html

ProtoJazz avatar Jun 24 '20 13:06 ProtoJazz

@balexand @ProtoJazz Can't find the documentation to use the change. Can you help me?

It hasn't been merged in. You could point at the fork this PR is based on in your mix file https://hexdocs.pm/mix/Mix.Tasks.Deps.html

I have pointed to it, was looking for docs in how to use the new pagination

hashim-sohail avatar Jun 24 '20 13:06 hashim-sohail