web: colocate graphql fragments, unmask where needed, more idiomatic client-preset use

This commit is contained in:
2026-05-19 01:49:58 +02:00
parent bc8642b1fc
commit b09ce9808d
29 changed files with 2065 additions and 7283 deletions
+18 -68
View File
@@ -97,72 +97,28 @@ const LeafBlocksFragmentDefinition = graphql(`
blockType
field
... on RichTextBlock {
rawValue
value
...RichTextBlock
}
... on ImageWithTextBlock {
image {
...Image
}
imageFormat
text
...ImageWithTextBlock
}
... on ImageSliderBlock {
images {
... on ImageSliderItemBlock {
image {
...Image
}
text
}
}
...ImageSliderBlock
}
... on HorizontalRuleBlock {
color
...HorizontalRuleBlock
}
... on FeaturedBlock {
title
featuredBlockText: text
linkText
imagePosition
backgroundColor
featuredPage {
contentType
pageType
url
... on EventPage {
featuredImage {
...Image
}
}
... on NewsPage {
featuredImage {
...Image
}
}
}
featuredImageOverride {
...Image
}
...FeaturedBlock
}
... on ContactListBlock {
items {
blockType
... on ContactEntityBlock {
contactEntity {
...ContactEntity
}
}
}
...ContactListBlock
}
... on EmbedBlock {
url
embed
rawEmbed
...EmbedBlock
}
... on FactBoxBlock {
backgroundColor
factBoxBody: body
...FactBoxBlock
}
}
`);
@@ -171,15 +127,13 @@ const OneLevelOfBlocksFragmentDefinition = graphql(`
fragment OneLevelOfBlocks on StreamFieldInterface {
...LeafBlocks
... on AccordionBlock {
heading
...AccordionBlock
body {
...LeafBlocks
}
}
... on PageSectionBlock {
title
backgroundColor
icon
...PageSectionBlock
body {
...LeafBlocks
}
@@ -189,39 +143,35 @@ const OneLevelOfBlocksFragmentDefinition = graphql(`
const BlockFragmentDefinition = graphql(`
fragment Blocks on StreamFieldInterface {
...OneLevelOfBlocks
... on AccordionBlock {
heading
...AccordionBlock
body {
...OneLevelOfBlocks
}
}
... on PageSectionBlock {
title
backgroundColor
icon
...PageSectionBlock
body {
...OneLevelOfBlocks
}
}
... on ContactSectionBlock {
title
text
...ContactSectionBlock
blocks {
...OneLevelOfBlocks
... on ContactSubsectionBlock {
title
text
...ContactSubsectionBlock
blocks {
...OneLevelOfBlocks
}
}
...OneLevelOfBlocks
}
}
...OneLevelOfBlocks
}
`);
const ImageFragmentDefinition = graphql(`
export const ImageFragmentDefinition = graphql(`
fragment Image on CustomImage {
id
url
@@ -232,7 +182,7 @@ const ImageFragmentDefinition = graphql(`
}
`);
const ContactEntityFragmentDefinition = graphql(`
export const ContactEntityFragmentDefinition = graphql(`
fragment ContactEntity on ContactEntity {
id
name