abstract-purpleA
Refine3y ago
5 replies
abstract-purple

GraphQL order_by precedence

I need to be able to specify the order of my order_by fields sent via the GraphQL client to Hasura. Currently, when I send two fields, the order is ignored. I reached out to Hasura and they say the query needs to be modified. I am sending:

sorters: {
      initial: [
        {
          field: "is_archived",
          order: "asc",
        },
        {
          field: "room_tag",
          order: "asc",
        },
      ],
    },


which results in the query:
order_by: {is_archived: asc, room_tag: asc}


but what I need to send is:
order_by: [{is_archived: asc}, {room_tag: asc}]


how can I send this via the standard hooks?
Was this page helpful?