Querying for non-null orders discount code doesn't work in Admin GQL API

admin_api_user
Shopify Partner
1 0 2

Based on the docs https://shopify.dev/api/admin-graphql/2021-10/queries/orders#argument-orders-query, `discount_code` is a valid query argument. The following query should've filtered out the orders without discount code, but it doesn't.

{
  orders(first: 10, query: "discount_code:*") {
    nodes {
      id
      discountCode
    }
  }
}

Instead it shows orders where discount code is `null`(see screenshot)

admin_api_user_0-1663053097878.png


Same query on another field `source_identifier` works fine.
Was able to reproduce the issue on https://shopify.dev/graphiql/admin-graphiql , the official Shopify GraphQL demo site.

Reply 1 (1)

garylake
Shopify Partner
2 0 0

I don't have a solution but bumping this in case someone picks it up... 

 

I've got a similar problem where I'm trying to select only email orders (not phone orders) and I'm trying: 

 

orders(first: 10, query: "email:*") 

 

To select orders where email is not null, and it's just returning all orders regardless...