For discussing the development and integration of subscription-enabled shops using Shopify's Subscription APIs.
GraphQL API can query Order.LineItems.SellingPlan.SellingPlanId
I can use query node(id:"sellingPlanIdHere") and obtain the selling plan from the sellingPlanId.
However, I also need to get the group for the selling plan. The selling plan does not have a `sellingPlanGroupId` property and neither does the line item . Is there a way to obtain the selling plan group from the selling plan without hunting through all the product's selling plans? (would be too inefficient and likely exceed throttle)
Hello @appdev2023!
We currently do not return the `sellingPlanGroupId` as part of the `sellingPlan`, but I will pass along this feedback to the team!
One other option, is that we can expose the `sellingPlanGroups` that are linked to the `Product`:
https://shopify.dev/docs/api/storefront/unstable/connections/SellingPlanGroupConnection
However, I realize that is also not the best solution as a single product can have multiple selling plan groups, each with multiple selling plans.
Josh (aka Master Chief) | Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
This actually will be immediately rejected by shopify throttle. hunt through unknown # products * unknown # groups * unknown # plans... it is just too much (ex: first10products*first10groups*first10plans is already 1000)
Any one of the following would resolve this:
Of course, #4 is preferable because the benefit isn't limited to line items.