Feature Request: Filter `discountNodes` by App ID or API Key

Many Shopify stores have thousands of discount codes, and it’s currently not possible to filter discountNodes to just those created by a specific app. This causes:

  • Slow lookups for apps managing discounts
  • Unnecessary pagination and API rate limiting
  • Difficulty estimating how many discounts an app has created

Feature request:
Allow filtering by appId or app_public_key in the discountNodes query, e.g.:

{
  discountNodes(
    query: "appId:APP_ID_HERE"
    # or
    query: "app_public_key:APP_PUBLIC_KEY_HERE"
  ) {
    id
  }
}

Additional query parameters could include functionId.

This would improve QOL for both developers, and merchants using our apps. Thanks.

1 Like

Hey @tobebuilds, I can pass this suggestion on to our product teams.

One question though, does the type filter work at all for this, or get you partially there? discountNodes - GraphQL Admin

Agreed with @tobebuilds

Knowing the discount nodes registered on the merchant’s store is critical for developers to be able to display feedback in our apps that the discount is created.

Just adding a simple appId or publicKey query interface would be enough.

The type filter doesn’t really help because there can be multiple functions of that type registered by other apps on the same merchant’s store that still introduces a pagination requirement possibility.

2 Likes

Thanks! Are you specifically wanting discounts for your own app, or to be able to specify other apps as well?

Thanks! Are you specifically wanting discounts for your own app, or to be able to specify other apps as well?

Yes, we want to display the discounts created through our own app in our app’s interface via the GraphQL API.

Without a filter, you cannot determine which discount nodes are created by your own app.

Yes, everything Dylan said, I agree with.

For now, my plan is to back up users’ discounts to our database for faster lookups and easier pagination. This approach has its fair share of cons, but it’s viable.