@@ -505,7 +505,7 @@ export type SettingsQueryResult = {
505
505
} ;
506
506
} | null ;
507
507
// Variable: getPageQuery
508
- // Query: *[_type == 'page' && slug.current == $slug][0]{ _id, _type, name, slug, heading, subheading, "pageBuilder": pageBuilder[]{ ..., _type == "callToAction" => { ..., link { ..., _type == "link" => { "page": page->slug.current, "post": post->slug.current } }, } }, }
508
+ // Query: *[_type == 'page' && slug.current == $slug][0]{ _id, _type, name, slug, heading, subheading, "pageBuilder": pageBuilder[]{ ..., _type == "callToAction" => { ..., link { ..., _type == "link" => { "page": page->slug.current, "post": post->slug.current } }, } }, }
509
509
export type GetPageQueryResult = {
510
510
_id : string ;
511
511
_type : "page" ;
@@ -566,12 +566,23 @@ export type GetPageQueryResult = {
566
566
} > ;
567
567
} > | null ;
568
568
} | null ;
569
+ // Variable: sitemapData
570
+ // Query: *[_type == "page" || _type == "post" && defined(slug.current)] | order(_type asc) { "slug": slug.current, _type, _updatedAt, }
571
+ export type SitemapDataResult = Array < {
572
+ slug : string ;
573
+ _type : "page" ;
574
+ _updatedAt : string ;
575
+ } | {
576
+ slug : string ;
577
+ _type : "post" ;
578
+ _updatedAt : string ;
579
+ } > ;
569
580
// Variable: allPostsQuery
570
581
// Query: *[_type == "post" && defined(slug.current)] | order(date desc, _updatedAt desc) { _id, "status": select(_originalId in path("drafts.**") => "draft", "published"), "title": coalesce(title, "Untitled"), "slug": slug.current, excerpt, coverImage, "date": coalesce(date, _updatedAt), "author": author->{firstName, lastName, picture}, }
571
582
export type AllPostsQueryResult = Array < {
572
583
_id : string ;
573
584
status : "draft" | "published" ;
574
- title : string | "Untitled" ;
585
+ title : string ;
575
586
slug : string ;
576
587
excerpt : string | null ;
577
588
coverImage : {
@@ -609,7 +620,7 @@ export type AllPostsQueryResult = Array<{
609
620
export type MorePostsQueryResult = Array < {
610
621
_id : string ;
611
622
status : "draft" | "published" ;
612
- title : string | "Untitled" ;
623
+ title : string ;
613
624
slug : string ;
614
625
excerpt : string | null ;
615
626
coverImage : {
@@ -643,7 +654,7 @@ export type MorePostsQueryResult = Array<{
643
654
} | null ;
644
655
} > ;
645
656
// Variable: postQuery
646
- // Query: *[_type == "post" && slug.current == $slug] [0] { content[]{ ..., markDefs[]{ ..., link { ..., _type == "link" => { "page": page->slug.current, "post": post->slug.current } } } }, _id, "status": select(_originalId in path("drafts.**") => "draft", "published"), "title": coalesce(title, "Untitled"), "slug": slug.current, excerpt, coverImage, "date": coalesce(date, _updatedAt), "author": author->{firstName, lastName, picture}, }
657
+ // Query: *[_type == "post" && slug.current == $slug] [0] { content[]{ ..., markDefs[]{ ..., _type == "link" => { "page": page->slug.current, "post": post->slug.current } } }, _id, "status": select(_originalId in path("drafts.**") => "draft", "published"), "title": coalesce(title, "Untitled"), "slug": slug.current, excerpt, coverImage, "date": coalesce(date, _updatedAt), "author": author->{firstName, lastName, picture}, }
647
658
export type PostQueryResult = {
648
659
content : Array < {
649
660
children ?: Array < {
@@ -657,30 +668,19 @@ export type PostQueryResult = {
657
668
markDefs : Array < {
658
669
linkType ?: "href" | "page" | "post" ;
659
670
href ?: string ;
660
- page ?: {
661
- _ref : string ;
662
- _type : "reference" ;
663
- _weak ?: boolean ;
664
- [ internalGroqTypeReferenceTo ] ?: "page" ;
665
- } ;
666
- post ?: {
667
- _ref : string ;
668
- _type : "reference" ;
669
- _weak ?: boolean ;
670
- [ internalGroqTypeReferenceTo ] ?: "post" ;
671
- } ;
671
+ page : string | null ;
672
+ post : string | null ;
672
673
openInNewTab ?: boolean ;
673
674
_type : "link" ;
674
675
_key : string ;
675
- link : null ;
676
676
} > | null ;
677
677
level ?: number ;
678
678
_type : "block" ;
679
679
_key : string ;
680
680
} > | null ;
681
681
_id : string ;
682
682
status : "draft" | "published" ;
683
- title : string | "Untitled" ;
683
+ title : string ;
684
684
slug : string ;
685
685
excerpt : string | null ;
686
686
coverImage : {
@@ -729,10 +729,11 @@ import "@sanity/client";
729
729
declare module "@sanity/client" {
730
730
interface SanityQueries {
731
731
"*[_type == \"settings\"][0]" : SettingsQueryResult ;
732
- "\n *[_type == 'page' && slug.current == $slug][0]{\n _id,\n _type,\n name,\n slug,\n heading,\n subheading,\n \"pageBuilder\": pageBuilder[]{\n ...,\n _type == \"callToAction\" => {\n ...,\n \n link {\n ...,\n _type == \"link\" => {\n \"page\": page->slug.current,\n \"post\": post->slug.current\n }\n }\n,\n }\n },\n }\n" : GetPageQueryResult ;
732
+ "\n *[_type == 'page' && slug.current == $slug][0]{\n _id,\n _type,\n name,\n slug,\n heading,\n subheading,\n \"pageBuilder\": pageBuilder[]{\n ...,\n _type == \"callToAction\" => {\n ...,\n \n link {\n ...,\n \n _type == \"link\" => {\n \"page\": page->slug.current,\n \"post\": post->slug.current\n }\n\n }\n,\n }\n },\n }\n" : GetPageQueryResult ;
733
+ "\n *[_type == \"page\" || _type == \"post\" && defined(slug.current)] | order(_type asc) {\n \"slug\": slug.current,\n _type,\n _updatedAt,\n }\n" : SitemapDataResult ;
733
734
"\n *[_type == \"post\" && defined(slug.current)] | order(date desc, _updatedAt desc) {\n \n _id,\n \"status\": select(_originalId in path(\"drafts.**\") => \"draft\", \"published\"),\n \"title\": coalesce(title, \"Untitled\"),\n \"slug\": slug.current,\n excerpt,\n coverImage,\n \"date\": coalesce(date, _updatedAt),\n \"author\": author->{firstName, lastName, picture},\n\n }\n" : AllPostsQueryResult ;
734
735
"\n *[_type == \"post\" && _id != $skip && defined(slug.current)] | order(date desc, _updatedAt desc) [0...$limit] {\n \n _id,\n \"status\": select(_originalId in path(\"drafts.**\") => \"draft\", \"published\"),\n \"title\": coalesce(title, \"Untitled\"),\n \"slug\": slug.current,\n excerpt,\n coverImage,\n \"date\": coalesce(date, _updatedAt),\n \"author\": author->{firstName, lastName, picture},\n\n }\n" : MorePostsQueryResult ;
735
- "\n *[_type == \"post\" && slug.current == $slug] [0] {\n content[]{\n ...,\n markDefs[]{\n ...,\n \n link {\n ...,\n _type == \"link\" => {\n \"page\": page->slug.current,\n \"post\": post->slug.current\n }\n }\n\n }\n },\n \n _id,\n \"status\": select(_originalId in path(\"drafts.**\") => \"draft\", \"published\"),\n \"title\": coalesce(title, \"Untitled\"),\n \"slug\": slug.current,\n excerpt,\n coverImage,\n \"date\": coalesce(date, _updatedAt),\n \"author\": author->{firstName, lastName, picture},\n\n }\n" : PostQueryResult ;
736
+ "\n *[_type == \"post\" && slug.current == $slug] [0] {\n content[]{\n ...,\n markDefs[]{\n ...,\n \n _type == \"link\" => {\n \"page\": page->slug.current,\n \"post\": post->slug.current\n }\n\n }\n },\n \n _id,\n \"status\": select(_originalId in path(\"drafts.**\") => \"draft\", \"published\"),\n \"title\": coalesce(title, \"Untitled\"),\n \"slug\": slug.current,\n excerpt,\n coverImage,\n \"date\": coalesce(date, _updatedAt),\n \"author\": author->{firstName, lastName, picture},\n\n }\n" : PostQueryResult ;
736
737
"\n *[_type == \"post\" && defined(slug.current)]\n {\"slug\": slug.current}\n" : PostPagesSlugsResult ;
737
738
"\n *[_type == \"page\" && defined(slug.current)]\n {\"slug\": slug.current}\n" : PagesSlugsResult ;
738
739
}
0 commit comments