Order collections by creation date

Benjamin RabierBenjamin RabierJamie BartonJamie Barton
Order collections by creation date

The Grafbase Database is deprecated. Use connectors to federate your existing data sources.

Grafbase now supports ordering results by the createdAt field for models in ascending or descending order — learn more.

Consider the following schema:

type User @model { name: String }

Using the generated userCollection query you can now pass orderBy with the field name and direction to sort results:

query { userCollection(first: 100, orderBy: { createdAt: ASC }) { edges { node { title } } } }

Schemas now come with the enum OrderByDirection which applies to fields which are indexed. This only applies to the createdAt field for now.

enum OrderByDirection { ASC DESC }

You will soon be able to add your own indexes to fields to allow ordering by other fields.

Youtube video thumbnail
  • Adds support for identity providers that use the same issuer for multiple applications
  • Modifies the PhoneNumber scalar to follow the E.164 format
  • Ensures that the ULID time component is equal to the createdAt field
  • Fixes the formatting of an unknown argument error
  • Fixes a few instances of input coercion to be in line with the GraphQL spec
  • Grafbase CLI 0.16.0 has been released to include all of the above.

We'd love to hear your feedback and ideas, so join us on Discord.