Possible values for sortKey for customerSegmentMembers?

Hi, it looks like there is no documentation for sortkey for customerSegmentMembers customerSegmentMembers - GraphQL Admin

I tried all possible values like ID or CREATED_AT but it doesn’t work. What actually works for sortkey?

Hey @Andrew_Jaanuu - thanks for flagging this. Usually, we define sortKeys as enums (like in the customers query here), I’m going to do some digging into this and see if this is intentional/to see if we can confirm expected behaviour. I’ll loop back with you here once I have next steps or more info share!

Hey @Andrew_Jaanuu, just following up here as I was able to touch base with some of our team responsible for the customer segment component. At the moment, we currently don’t support CREATED_AT as a sortKey enum, but here are the currently available ones that can be passed as strings in the query:

  • customer_id (default)
  • created_at
  • first_order_date
  • last_abandoned_order_date
  • last_order_date
  • orders_count
  • total_spent

Could you try running something like the below and letting me know if it works for you?

{
  customerSegmentMembers (first: 10, segmentId: "id-here" sortKey:"created_at") {
    # customerSegmentMembers fields
  }
}

Hope this helps, let me know if I can clarify anything on our end here as always!