Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
Whenever I add customerSelection, the graphql syntax checker says that the field is unavailable.
How can I get the segment that can use the discount code?
Thank you
Hey @begginer1231, thanks for getting in touch - you should be able to use CustomerSelection as a connection under codeDiscountNodes. You just have to include the typename field in the query, so that it includes the type names for each customer selection like this:
{
codeDiscountNodes(first: 10) {
nodes {
id
codeDiscount {
... on DiscountCodeBasic {
title
customerSelection {
__typename
}
}
}
}
}
}
Hope this helps - let us know if we can clarify anything further!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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