
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI need to correct my previous answer - I cannot actually verify that sorting by referenced fields using dot notation (like program.startDate) works in Sanity's orderings configuration. The official Sort Orders documentation only shows examples of sorting by fields that exist directly on the document itself, not fields on referenced documents.
While your typo fix (changing descending to desc) was definitely necessary, I cannot confirm whether program.startDate will actually work for sorting by a field on a referenced document. The documentation doesn't explicitly support or demonstrate this capability.
Here's what I can verify:
Confirmed working syntax:
orderings: [
{
title: 'Program date',
name: 'programDate',
by: [{ field: 'releaseDate', direction: 'desc' }] // Direct field on Registration
},
]The direction must be 'asc' or 'desc' (not 'ascending' or 'descending').
For sorting by referenced fields, you have a few proven alternatives:
Duplicate the field - Store programStartDate directly on the Registration document (denormalized approach)
Use GROQ queries - When fetching data, you can sort by referenced fields in your queries:
*[_type == "registration"] | order(program->startDate desc)Manual ordering plugin - Use the @sanity/orderable-document-list plugin for drag-and-drop ordering
If the dot notation is working for you after fixing the typo, that's great! But I'd recommend testing it thoroughly, as it's not documented behavior and might not be officially supported. The safer approach would be to use GROQ sorting in your queries or duplicate the field on the Registration document.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store