I had to alias a repeatable component heading
when querying the data to my NextJS app to get the query to work, here is the query:
query {
pages (where: {
slug: "home"
partner: {
slug: "${process.env.PARTNER}"
}
}) {
id
slug
title
blocks {
__typename
... on ComponentHeroHeroWithVideo {
_template: template
id
heading
css_classes
muted
video_url
poster_url
loop
playsinline
autoplay
}
... on ComponentContentParagraph {
_template: template
id
paragraph_options_inner {
text
css_classes_text
id
}
css_classes
}
... on ComponentListsProgramsGrid {
_template: template
id
css_classes
headings: heading {
text
css_classes
}
}
}
}
}
Everything works fine up until the point where I need to save the data from my frontend (TinaCMS/NextJS). My issue is I need to alias the headings
back to heading
in my mutation but Im not sure how that would work using Dynamic Zone fields. Here is my current mutation when saving:
mutation UpdatePage(
$id: ID!
$title: String
$blocks: [PagesBlocksDynamicZoneInput!]
) {
updatePage (
input: {
where: { id: $id}
data: {
title: $title
blocks: $blocks
}
}
) {
page {
id
}
}
}
Can someone give an example of how I could drill down further into the blocks
Dynamic Zone in my mutation example to specify this alias? Thanks.