Skip to content

Instantly share code, notes, and snippets.

@mornir
Created July 12, 2025 16:00
Show Gist options
  • Save mornir/2c45c6c402b0902fd634da70e4b80523 to your computer and use it in GitHub Desktop.
Save mornir/2c45c6c402b0902fd634da70e4b80523 to your computer and use it in GitHub Desktop.
GROQ custom function
fn utils::expandLink($lang) = $lang[]{
...,
markDefs[]{
...,
_type == "internalLink" => {
"slug": @.reference->number,
"type": @.reference->_type,
}
}
};
*[_type == "title"]{
...,
desc {
"de": utils::expandLink(de),
"fr": utils::expandLink(fr),
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment