Hi,
I'm currently using Next.js with the slice machine and have a slice called "FAQSection" which has links to the custom type "FAQ". I also have different custom types for different types of pages, and for each page I use the same query, but change the type and uid like so:
export const PAGE_LINKS = [
"faq.questionName",
"faq.acceptedAnswerText",
];
prismicDocument = await client.getByUID(type, uid, {
fetchLinks: PAGE_LINKS,
lang: locale,
});
I'm running into the problem where fetchLinks does not fetch more than 1 paragraph for a rich text field (acceptedAnswerText), so apparently the solution is to use graphQuery instead. I've tried doing this like so:
export const graphQuery = `
{
pageType1 {
slices {
...on faq_section {
variation {
...on default {
primary {
...primaryFields
}
items {
...itemsFields
faq {
acceptedAnswerText
questionName
}
}
}
}
}
}
}
}
`;
but am encountering some problems.
- It does not load other slices, do I have to add each one manually here?
- It is not loading stuff like SEO metadata. It is not clear
- I have loads of types apart from "pageType1" that have this FAQ section slice, do I really need to add each one here?
Ideally I would just keep using fetchLinks and have it fetch more paragraphs for the rich text (why is this even a thing?), but since that is seemingly impossible, can you guys help out with this?