feat(SW-285): Add support for sidebar

This commit is contained in:
Chuma McPhoy
2024-09-02 22:43:08 +02:00
parent 60636d8cbe
commit a444746ccb
14 changed files with 594 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
#import "../Fragments/Image.graphql"
#import "../Fragments/Blocks/Card.graphql"
#import "../Fragments/Blocks/LoyaltyCard.graphql"
@@ -112,6 +113,66 @@ query GetContentPage($locale: String!, $uid: String!) {
preamble
}
hero_image
sidebar {
__typename
... on ContentPageSidebarDynamicContent {
dynamic_content {
component
}
}
... on ContentPageSidebarJoinLoyaltyContact {
join_loyalty_contact {
title
preamble
button {
cta_text
external_link {
title
href
}
open_in_new_tab
linkConnection {
edges {
node {
__typename
...AccountPageLink
...ContentPageLink
...LoyaltyPageLink
}
}
}
}
contact {
... on ContentPageSidebarJoinLoyaltyContactBlockContactContact {
__typename
contact {
display_text
contact_field
footnote
}
}
}
}
}
... on ContentPageSidebarContent {
content {
content {
json
embedded_itemsConnection {
edges {
node {
__typename
...Image
...LoyaltyPageLink
...ContentPageLink
}
}
totalCount
}
}
}
}
}
system {
uid
created_at
@@ -203,6 +264,51 @@ query GetContentPageRefs($locale: String!, $uid: String!) {
}
}
}
sidebar {
... on ContentPageSidebarContent {
__typename
content {
content {
embedded_itemsConnection {
edges {
node {
# No fragments used since we want to include __typename for each type to avoid fetching SystemAsset
... on ContentPage {
__typename
system {
...System
}
}
... on LoyaltyPage {
__typename
system {
...System
}
}
}
}
}
}
}
}
... on ContentPageSidebarJoinLoyaltyContact {
__typename
join_loyalty_contact {
button {
linkConnection {
edges {
node {
__typename
...AccountPageRef
...ContentPageRef
...LoyaltyPageRef
}
}
}
}
}
}
}
system {
...System
}
@@ -212,16 +318,25 @@ query GetContentPageRefs($locale: String!, $uid: String!) {
query GetDaDeEnUrlsContentPage($uid: String!) {
de: all_content_page(where: { uid: $uid }, locale: "de") {
items {
web {
original_url
}
url
}
}
en: all_content_page(where: { uid: $uid }, locale: "en") {
items {
web {
original_url
}
url
}
}
da: all_content_page(where: { uid: $uid }, locale: "da") {
items {
web {
original_url
}
url
}
}
@@ -230,16 +345,25 @@ query GetDaDeEnUrlsContentPage($uid: String!) {
query GetFiNoSvUrlsContentPage($uid: String!) {
fi: all_content_page(where: { uid: $uid }, locale: "fi") {
items {
web {
original_url
}
url
}
}
no: all_content_page(where: { uid: $uid }, locale: "no") {
items {
web {
original_url
}
url
}
}
sv: all_content_page(where: { uid: $uid }, locale: "sv") {
items {
web {
original_url
}
url
}
}