# Ordering and Sorting Data

To sort accounts data we need to apply <mark style="color:yellow;">**order\_by**</mark> command on data fields of our choice.

For example to fetch **all** **spl-governance proposalsV2** where governing mint is **Grape token** sorted by **drafting date**. For this we can apply order **order\_by** on **draftAt.**

{% hint style="info" %}
Use our [GraphQL demo project](https://github.com/Shyft-to/community-projects/tree/main/graphql-demo) to try out these queries in code.
{% endhint %}

The resulting query looks like

<mark style="color:yellow;">**ProposalsV2 where governing mint is Grape token sorted by drafting date**</mark>

```graphql
query MyQuery {
  GovER5Lthms3bLBqWub97yVrMmEogzX7xNjdXpPPCVZw_ProposalV2(
    where: {governingTokenMint: {_eq: "8upjSpvjcdpuzhfR1zriwg5NXkwDruejqNE9WNbPRtyA"}}
    order_by: {draftAt: desc}
  ) {
    name
    pubkey
    draftAt
  }
}
```

<figure><img src="https://2394289113-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4XnSsBH76iytbI7NwX5o%2Fuploads%2FDSvzHLk5fneN9BtyC0bj%2Fezgif.com-video-to-gif%20(5).gif?alt=media&#x26;token=f9638a73-a3da-45e5-a418-953a0c8ab3e6" alt=""><figcaption></figcaption></figure>
