Skip to content

Commit 40d9198

Browse files
committed
query for everything to include the missing fields
1 parent 517c430 commit 40d9198

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

nextjs-app/sanity.types.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ export type SettingsQueryResult = {
505505
};
506506
} | null;
507507
// 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 } }, }, _type == "infoSection" => { content[]{ ..., markDefs[]{ ..., _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 } }, }, _type == "infoSection" => { ..., content[]{ ..., markDefs[]{ ..., _type == "link" => { "page": page->slug.current, "post": post->slug.current } } } }, }, }
509509
export type GetPageQueryResult = {
510510
_id: string;
511511
_type: "page";
@@ -708,7 +708,7 @@ import "@sanity/client";
708708
declare module "@sanity/client" {
709709
interface SanityQueries {
710710
"*[_type == \"settings\"][0]": SettingsQueryResult;
711-
"\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 link {\n ...,\n \n _type == \"link\" => {\n \"page\": page->slug.current,\n \"post\": post->slug.current\n }\n\n }\n,\n },\n _type == \"infoSection\" => {\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 },\n }\n": GetPageQueryResult;
711+
"\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 _type == \"infoSection\" => {\n ...,\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 },\n }\n": GetPageQueryResult;
712712
"\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;
713713
"\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;
714714
"\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;

nextjs-app/sanity/lib/queries.ts

+2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ export const getPageQuery = defineQuery(`
3838
"pageBuilder": pageBuilder[]{
3939
...,
4040
_type == "callToAction" => {
41+
...,
4142
${linkFields},
4243
},
4344
_type == "infoSection" => {
45+
...,
4446
content[]{
4547
...,
4648
markDefs[]{

0 commit comments

Comments
 (0)