Closed coren-frankel closed 3 months ago
Hey, thanks for raising this, and thanks for all the information you provided.
Unfortunately, there's not a lot we'll be able to do about this from this repo, since it only contains a client package for the API.
I will forward this internally to the appropriate team, but we won't be able to track progress here, so I'm going to close this issue. In the future, we recommend that API issues be reported via Partner support.
Understood. Thank you for passing it on!
Overview
In my efforts to query all vendors from a store using the admin GraphQL client, I stumbled on someone else's deep dive into attempting the same on the Shopify Community discussion boards.
As the OP's question in that thread points out, there is no way to use the
productVendors
field in a grapqhl query for all vendors (if there are more than 250) because thefirst
parameter is available, but acursor
parameter is not.The cursor is already available when querying for productVendors, so I assume the proposed change is low hanging fruit. Here is how the productVendors query maxes out without access to the cursor param:
As I understand it, the alternative (and best) graphql approach is to query all products for vendor names:
Then after iteratively collecting all product edges with only the vendor name on each node, you need to reduce the list with a Set to get unique vendors. In my remix/TS project for example:
That all just seems so clunky when the
productVendors
field is already equipped with cursors.What's it going to take to make the graphql
productVendors
field more useful? I would be open to alternative solutions, but I think I'm not alone in seeing this as a small but persistent problem with the graphql API client.