fix(SW-194): add accordion graphql request

This commit is contained in:
Matilda Landström
2024-10-02 18:35:27 +02:00
parent bdb4aacc32
commit 166ddca0e0
4 changed files with 137 additions and 0 deletions

View File

@@ -0,0 +1,122 @@
#import "../PageLink/AccountPageLink.graphql"
#import "../PageLink/ContentPageLink.graphql"
#import "../PageLink/HotelPageLink.graphql"
#import "../PageLink/LoyaltyPageLink.graphql"
#import "../AccountPage/Ref.graphql"
#import "../ContentPage/Ref.graphql"
#import "../HotelPage/Ref.graphql"
#import "../LoyaltyPage/Ref.graphql"
fragment Accordion_ContentPage on ContentPageBlocksAccordion {
__typename
accordion {
title
faq {
__typename
...GlobalFaq
...SpecificFaq
}
}
}
fragment GlobalFaq on ContentPageBlocksAccordionBlockFaqGlobalFaq {
__typename
global_faq {
global_faqConnection {
edges {
node {
... on Accordion {
__typename
title
questions {
question
answer {
json
embedded_itemsConnection {
edges {
node {
__typename
...ContentPageLink
}
}
}
}
}
}
}
}
}
}
}
fragment SpecificFaq on ContentPageBlocksAccordionBlockFaqSpecificFaq {
__typename
specific_faq {
questions {
question
answer {
json
embedded_itemsConnection {
edges {
node {
__typename
...ContentPageLink
}
}
}
}
}
}
}
fragment Accordion_ContentPageRefs on ContentPageBlocksAccordion {
accordion {
faq {
...GlobalFaqRefs
...SpecificFaqRefs
}
}
}
fragment GlobalFaqRefs on ContentPageBlocksAccordionBlockFaqGlobalFaq {
global_faq {
global_faqConnection {
edges {
node {
... on Accordion {
questions {
answer {
embedded_itemsConnection {
edges {
node {
__typename
...ContentPageRef
}
}
}
}
}
}
}
}
}
}
}
fragment SpecificFaqRefs on ContentPageBlocksAccordionBlockFaqSpecificFaq {
specific_faq {
questions {
answer {
embedded_itemsConnection {
edges {
node {
__typename
...ContentPageRef
}
}
}
}
}
}
}

View File

@@ -1,5 +1,6 @@
#import "../../Fragments/System.graphql"
#import "../../Fragments/Blocks/Accordion.graphql"
#import "../../Fragments/Blocks/CardsGrid.graphql"
#import "../../Fragments/Blocks/Content.graphql"
#import "../../Fragments/Blocks/DynamicContent.graphql"
@@ -23,6 +24,17 @@ query GetContentPage($locale: String!, $uid: String!) {
preamble
...NavigationLinks
}
blocks {
__typename
...CardsGrid_ContentPage
...Content_ContentPage
...DynamicContent_ContentPage
...Shortcuts_ContentPage
...Table_ContentPage
...TextCols_ContentPage
...UspGrid_ContentPage
...Accordion_ContentPage
}
sidebar {
__typename
...ContentSidebar_ContentPage
@@ -70,6 +82,7 @@ query GetContentPageRefs($locale: String!, $uid: String!) {
}
blocks {
__typename
...Accordion_ContentPageRefs
...CardsGrid_ContentPageRefs
...Content_ContentPageRefs
...DynamicContent_ContentPageRefs

View File

@@ -130,6 +130,7 @@ export async function request<T>(
* version for one language, it throws an error which we have to recover
* from here since it isn't an error.
*/
return { data: error.response.data as T }
}
}

View File

@@ -1,6 +1,7 @@
export namespace ContentPageEnum {
export namespace ContentStack {
export const enum blocks {
Accordion = "ContentPageBlocksAccordion",
CardsGrid = "ContentPageBlocksCardsGrid",
Content = "ContentPageBlocksContent",
DynamicContent = "ContentPageBlocksDynamicContent",