---
schema_version: "1"
id: 3e0091c81e9ba0faffcbc0e97ccbc3b0b17204a72f60afa1e66c12054a498faa
title: Order By Considerations
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/graphql-api/graphql/guides/order-considerations.md
canonical_url: https://developer.salesforce.com/docs/platform/graphql/guide/order-considerations.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6f85e63005a97207297c6ffa2c8d0aebe5924d2b1bee7a70b16e6a95dd7bf493
products:
  - GraphQL API
---
# Order By Considerations

| AVAILABLE API VERSION |
| --------------------- |
| API v56.0 and later   |

`orderBy` is compatible with relationship queries. For example, you can order by `Account.Name` like this.

```
query industry {
  uiapi {
    query {
      Case ( orderBy: { Account: { Name:  { order: ASC }}}) {
        edges {
          node {
            Id
            CaseNumber { value }
            AccountId { value }
            Account { Name { value }}
          }
        }
      }
    }
  }
}
```

The previous query is similar to the following SOQL statement.

```
SELECT Id, CaseNumber, AccountId, Account.Name
FROM Case
ORDER BY Account.Name
```

Additionally, the `orderBy` argument follows these SOQL limitations.

- The sort order depends on your user locale setting. For English locales, SOQL uses the UTF-8 values of the uppercase character to create a sort order. In other words, sorting for English locales is case insensitive.

- For non-English locales, SOQL uses a pre-defined order that is natural for the locale specified. This is because different cultures may sort the same characters in different ways, and this nuance can't be captured by the UTF-8 values alone.

By default, the first 10 results are returned with [pagination information](https://developer.salesforce.com/docs/platform/graphql/guide/paginate.md). You can request for a larger number of results to be returned by using the `first` argument.

```
Case ( first:50, orderBy: { Account: { Name:  { order: ASC }}})
```

The previous query is similar to the following SOQL ORDER BY clause.

```
ORDER BY Account.Name ASC LIMIT 50
```
