From 08b833b34c96f34641f59f83d282719d55b52758 Mon Sep 17 00:00:00 2001 From: Mathias Oterhals Myklebust Date: Fri, 23 Aug 2024 13:15:48 +0200 Subject: [PATCH] fix(queries): map slug to internalLink for more section types --- studio/lib/queries/pages.ts | 38 ++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/studio/lib/queries/pages.ts b/studio/lib/queries/pages.ts index b2a52e399..37d140c10 100644 --- a/studio/lib/queries/pages.ts +++ b/studio/lib/queries/pages.ts @@ -15,7 +15,43 @@ const SECTIONS_FRAGMENT = groq` } } } - } + }, + _type == "article" => { + ..., + link { + ..., + linkType == "internal" => { + ..., + "internalLink": internalLink->{ + "_ref": slug.current + } + } + } + }, + _type == "callout" => { + ..., + link { + ..., + linkType == "internal" => { + ..., + "internalLink": internalLink->{ + "_ref": slug.current + } + } + } + }, + _type == "ctaSection" => { + ..., + callToActions[] { + ..., + linkType == "internal" => { + ..., + "internalLink": internalLink->{ + "_ref": slug.current + } + } + } + }, } `;