fix(SW-194): break out blocks to separate query
This commit is contained in:
@@ -8,6 +8,27 @@
|
|||||||
#import "../HotelPage/Ref.graphql"
|
#import "../HotelPage/Ref.graphql"
|
||||||
#import "../LoyaltyPage/Ref.graphql"
|
#import "../LoyaltyPage/Ref.graphql"
|
||||||
|
|
||||||
|
#import "./Refs/Accordion.graphql"
|
||||||
|
|
||||||
|
fragment AccordionBlock on Accordion {
|
||||||
|
__typename
|
||||||
|
title
|
||||||
|
questions {
|
||||||
|
question
|
||||||
|
answer {
|
||||||
|
json
|
||||||
|
embedded_itemsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
__typename
|
||||||
|
...ContentPageLink
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fragment Accordion_ContentPage on ContentPageBlocksAccordion {
|
fragment Accordion_ContentPage on ContentPageBlocksAccordion {
|
||||||
__typename
|
__typename
|
||||||
accordion {
|
accordion {
|
||||||
@@ -26,24 +47,7 @@ fragment GlobalFaq on ContentPageBlocksAccordionBlockFaqGlobalFaq {
|
|||||||
global_faqConnection {
|
global_faqConnection {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
... on Accordion {
|
...AccordionBlock
|
||||||
__typename
|
|
||||||
title
|
|
||||||
questions {
|
|
||||||
question
|
|
||||||
answer {
|
|
||||||
json
|
|
||||||
embedded_itemsConnection {
|
|
||||||
edges {
|
|
||||||
node {
|
|
||||||
__typename
|
|
||||||
...ContentPageLink
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -85,20 +89,7 @@ fragment GlobalFaqRefs on ContentPageBlocksAccordionBlockFaqGlobalFaq {
|
|||||||
global_faqConnection {
|
global_faqConnection {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
... on Accordion {
|
...AccordionBlockRefs
|
||||||
questions {
|
|
||||||
answer {
|
|
||||||
embedded_itemsConnection {
|
|
||||||
edges {
|
|
||||||
node {
|
|
||||||
__typename
|
|
||||||
...ContentPageRef
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
16
lib/graphql/Fragments/Blocks/Refs/Accordion.graphql
Normal file
16
lib/graphql/Fragments/Blocks/Refs/Accordion.graphql
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#import "../../ContentPage/Ref.graphql"
|
||||||
|
|
||||||
|
fragment AccordionBlockRefs on Accordion {
|
||||||
|
questions {
|
||||||
|
answer {
|
||||||
|
embedded_itemsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
__typename
|
||||||
|
...ContentPageRef
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,17 +23,6 @@ query GetContentPage($locale: String!, $uid: String!) {
|
|||||||
preamble
|
preamble
|
||||||
...NavigationLinks
|
...NavigationLinks
|
||||||
}
|
}
|
||||||
blocks {
|
|
||||||
__typename
|
|
||||||
...Accordion_ContentPage
|
|
||||||
...CardsGrid_ContentPage
|
|
||||||
...Content_ContentPage
|
|
||||||
...DynamicContent_ContentPage
|
|
||||||
...Shortcuts_ContentPage
|
|
||||||
...Table_ContentPage
|
|
||||||
...TextCols_ContentPage
|
|
||||||
...UspGrid_ContentPage
|
|
||||||
}
|
|
||||||
sidebar {
|
sidebar {
|
||||||
__typename
|
__typename
|
||||||
...ContentSidebar_ContentPage
|
...ContentSidebar_ContentPage
|
||||||
@@ -52,6 +41,7 @@ query GetContentPageBlocks($locale: String!, $uid: String!) {
|
|||||||
content_page(uid: $uid, locale: $locale) {
|
content_page(uid: $uid, locale: $locale) {
|
||||||
blocks {
|
blocks {
|
||||||
__typename
|
__typename
|
||||||
|
...Accordion_ContentPage
|
||||||
...CardsGrid_ContentPage
|
...CardsGrid_ContentPage
|
||||||
...Content_ContentPage
|
...Content_ContentPage
|
||||||
...DynamicContent_ContentPage
|
...DynamicContent_ContentPage
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
#import "../../Fragments/PageLink/HotelPageLink.graphql"
|
#import "../../Fragments/PageLink/HotelPageLink.graphql"
|
||||||
#import "../../Fragments/PageLink/LoyaltyPageLink.graphql"
|
#import "../../Fragments/PageLink/LoyaltyPageLink.graphql"
|
||||||
|
|
||||||
|
#import "../../Fragments/Blocks/Accordion.graphql"
|
||||||
|
|
||||||
query GetHotelPage($locale: String!, $uid: String!) {
|
query GetHotelPage($locale: String!, $uid: String!) {
|
||||||
hotel_page(locale: $locale, uid: $uid) {
|
hotel_page(locale: $locale, uid: $uid) {
|
||||||
hotel_page_id
|
hotel_page_id
|
||||||
@@ -15,24 +17,7 @@ query GetHotelPage($locale: String!, $uid: String!) {
|
|||||||
__typename
|
__typename
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
... on Accordion {
|
...AccordionBlock
|
||||||
__typename
|
|
||||||
title
|
|
||||||
questions {
|
|
||||||
question
|
|
||||||
answer {
|
|
||||||
json
|
|
||||||
embedded_itemsConnection {
|
|
||||||
edges {
|
|
||||||
node {
|
|
||||||
__typename
|
|
||||||
...ContentPageLink
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,10 +34,9 @@ export const contentPageQueryRouter = router({
|
|||||||
if (!contentPageRefs) {
|
if (!contentPageRefs) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
//console.log("EYY", contentPageRefs.content_page.blocks[1])
|
|
||||||
//console.log("EYY", contentPageRefs.content_page.blocks[0])
|
|
||||||
const tags = generatePageTags(contentPageRefs, lang)
|
const tags = generatePageTags(contentPageRefs, lang)
|
||||||
//console.log("tags", tags)
|
|
||||||
getContentPageCounter.add(1, { lang, uid })
|
getContentPageCounter.add(1, { lang, uid })
|
||||||
console.info(
|
console.info(
|
||||||
"contentstack.contentPage start",
|
"contentstack.contentPage start",
|
||||||
@@ -86,7 +85,7 @@ export const contentPageQueryRouter = router({
|
|||||||
console.error(contentPage.error?.format())
|
console.error(contentPage.error?.format())
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
//console.log("HEJ2", contentPage.data.content_page.blocks[0])
|
|
||||||
const tracking: TrackingSDKPageData = {
|
const tracking: TrackingSDKPageData = {
|
||||||
pageId: contentPage.data.content_page.system.uid,
|
pageId: contentPage.data.content_page.system.uid,
|
||||||
lang: contentPage.data.content_page.system.locale as Lang,
|
lang: contentPage.data.content_page.system.locale as Lang,
|
||||||
|
|||||||
Reference in New Issue
Block a user