add support for page sections on generic pages

This commit is contained in:
2024-06-21 23:13:15 +02:00
parent 82f451cb14
commit 41f5297a12
16 changed files with 683 additions and 93 deletions

View File

@ -37,8 +37,8 @@ export function unique<T>(array: any[]): any[] {
return Array.from(array.reduce((set, item) => set.add(item), new Set()));
}
const BlockFragmentDefinition = graphql(`
fragment Blocks on StreamFieldInterface {
const OneLevelOfBlocksFragmentDefinition = graphql(`
fragment OneLevelOfBlocks on StreamFieldInterface {
id
blockType
field
@ -93,6 +93,19 @@ const BlockFragmentDefinition = graphql(`
}
`);
const BlockFragmentDefinition = graphql(`
fragment Blocks on StreamFieldInterface {
... on PageSectionBlock {
title
backgroundColor
body {
...OneLevelOfBlocks
}
}
...OneLevelOfBlocks
}
`);
const ImageFragmentDefinition = graphql(`
fragment Image on CustomImage {
id