Feat(SW-3708): refactor contentstack fetching (removing all refs) and cache invalidation * Remove all REFS * Revalidate correct language * PR fixes * PR fixes * Throw when errors from contentstack api Approved-by: Joakim Jäderberg
83 lines
2.0 KiB
TypeScript
83 lines
2.0 KiB
TypeScript
import { gql } from "graphql-tag"
|
|
|
|
import { CardsGrid_StartPage } from "../../Fragments/Blocks/CardsGrid.graphql"
|
|
import { CarouselCards_StartPage } from "../../Fragments/Blocks/CarouselCards.graphql"
|
|
import { FullWidthCampaign } from "../../Fragments/Blocks/FullWidthCampaign.graphql"
|
|
import { JoinScandicFriends_StartPage } from "../../Fragments/Blocks/JoinScandicFriends.graphql"
|
|
import { VideoCard_StartPage } from "../../Fragments/Blocks/VideoCard.graphql"
|
|
import { System } from "../../Fragments/System.graphql"
|
|
|
|
export const GetStartPage = gql`
|
|
query GetStartPage($locale: String!, $uid: String!) {
|
|
start_page(locale: $locale, uid: $uid) {
|
|
title
|
|
url
|
|
header {
|
|
heading
|
|
hero_image
|
|
}
|
|
blocks {
|
|
__typename
|
|
...CardsGrid_StartPage
|
|
...CarouselCards_StartPage
|
|
... on StartPageBlocksFullWidthCampaign {
|
|
__typename
|
|
full_width_campaign {
|
|
full_width_campaignConnection {
|
|
edges {
|
|
node {
|
|
...FullWidthCampaign
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
...JoinScandicFriends_StartPage
|
|
...VideoCard_StartPage
|
|
}
|
|
system {
|
|
...System
|
|
created_at
|
|
updated_at
|
|
}
|
|
}
|
|
trackingProps: start_page(locale: "en", uid: $uid) {
|
|
url
|
|
}
|
|
}
|
|
${System}
|
|
${CardsGrid_StartPage}
|
|
${FullWidthCampaign}
|
|
${CarouselCards_StartPage}
|
|
${JoinScandicFriends_StartPage}
|
|
${VideoCard_StartPage}
|
|
`
|
|
|
|
export const GetDaDeEnUrlsStartPage = gql`
|
|
query GetDaDeEnUrlsStartPage($uid: String!) {
|
|
de: start_page(locale: "de", uid: $uid) {
|
|
url
|
|
}
|
|
en: start_page(locale: "en", uid: $uid) {
|
|
url
|
|
}
|
|
da: start_page(locale: "da", uid: $uid) {
|
|
url
|
|
}
|
|
}
|
|
`
|
|
|
|
export const GetFiNoSvUrlsStartPage = gql`
|
|
query GetFiNoSvUrlsStartPage($uid: String!) {
|
|
fi: start_page(locale: "fi", uid: $uid) {
|
|
url
|
|
}
|
|
no: start_page(locale: "no", uid: $uid) {
|
|
url
|
|
}
|
|
sv: start_page(locale: "sv", uid: $uid) {
|
|
url
|
|
}
|
|
}
|
|
`
|