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

Improve PromotionRule.gifts field by returning ProductVariant types instead of IDs. #15285

Open
zedzior opened this issue Jan 24, 2024 · 0 comments

Comments

@zedzior
Copy link
Member

zedzior commented Jan 24, 2024

After implementing this, field PromotionRule.gifts returns a list of ProductVariant IDs:

type PromotionRule implements Node @doc(category: "Discounts"){
  ...
  gifts: [ID!]
  ...
}

Would be good to return ProductVariant types instead, like:

type PromotionRule implements Node @doc(category: "Discounts"){
  ...
  gifts: [ProductVariant!]
  ...
}

The problem is ProductVariant type exists in channel context and PromotionRule can be assocciated with multiple channels.

One of the solution is to return some kind of narrowed ProductVariant type, which excludes all the fields, which derive from ProductVariantChannelListing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants