Hi, i just try to develop my first prismic project – a simple portfolio.
So i have Pages for every Project/Case, but also a Custom Type for ProjectTeaser with content realtions fields for image/stageimage, projecttitle and projecttagline.
No i want to query these data from the homepage to show a slider of Projectteasers there. But i can't get it to work.
my query looks like this atm:
const teasers = await client.getAllByType("projectteaser", {
graphQuery: `{
projectteaser {
projecttitle {
...on Project {
title
}
}
}
}`
})
the definition of my project and projectteaser looks like this:
projectteaser
{
"id": "projectteaser",
"label": "ProjectTeaser",
"format": "custom",
"repeatable": true,
"status": true,
"json": {
"Main": {
"uid": {
"config": {
"label": "UID"
},
"type": "UID"
},
"linked_stageimage": {
"type": "Link",
"config": {
"label": "LinkedStageImage",
"select": "document"
}
},
"linked_projecttitle": {
"type": "Link",
"config": {
"label": "LinkedProjectTitle",
"select": "document"
}
},
"linked_projecttagline": {
"type": "Link",
"config": {
"label": "LinkedProjectTagline",
"select": "document"
}
}
}
}
}
project
{
"id": "project",
"label": "Project",
"format": "page",
"repeatable": true,
"status": true,
"json": {
"Main": {
"uid": {
"config": {
"label": "UID"
},
"type": "UID"
},
"slices": {
"type": "Slices",
"fieldset": "Slice Zone",
"config": {
"choices": {
"stage": {
"type": "SharedSlice"
},
"background": {
"type": "SharedSlice"
},
"project_intro": {
"type": "SharedSlice"
}
}
}
}
},
"SEO & Metadata": {
"meta_description": {
"config": {
"label": "Meta Description",
"placeholder": "A brief summary of the page"
},
"type": "Text"
},
"meta_image": {
"config": {
"constraint": {
"height": 1260,
"width": 2400
},
"label": "Meta Image",
"thumbnails": []
},
"type": "Image"
},
"meta_title": {
"config": {
"label": "Meta Title",
"placeholder": "A title of the page used for social media and search engines"
},
"type": "Text"
}
}
}
}
second question is, if this is the way to go for my usecase, even if it works. Thanks for any help or nudge in the right dorection in advance