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
152 lines
4.8 KiB
TypeScript
152 lines
4.8 KiB
TypeScript
import { gql } from "graphql-tag"
|
|
|
|
import { Accordion_ContentPage } from "../../Fragments/Blocks/Accordion.graphql"
|
|
import { CardsGrid_ContentPage } from "../../Fragments/Blocks/CardsGrid.graphql"
|
|
import { Content_ContentPage } from "../../Fragments/Blocks/Content.graphql"
|
|
import { DynamicContent_ContentPage } from "../../Fragments/Blocks/DynamicContent.graphql"
|
|
import { HotelListing_ContentPage } from "../../Fragments/Blocks/HotelListing.graphql"
|
|
import { Jotform_ContentPage } from "../../Fragments/Blocks/Jotform.graphql"
|
|
import { Shortcuts_ContentPage } from "../../Fragments/Blocks/Shortcuts.graphql"
|
|
import { Table_ContentPage } from "../../Fragments/Blocks/Table.graphql"
|
|
import { TextCols_ContentPage } from "../../Fragments/Blocks/TextCols.graphql"
|
|
import { UspGrid_ContentPage } from "../../Fragments/Blocks/UspGrid.graphql"
|
|
import { Video_ContentPage } from "../../Fragments/Blocks/Video.graphql"
|
|
import { VideoCard_ContentPage } from "../../Fragments/Blocks/VideoCard.graphql"
|
|
import { NavigationLinks_ContentPage } from "../../Fragments/ContentPage/NavigationLinks.graphql"
|
|
import { TopPrimaryButton_ContentPage } from "../../Fragments/ContentPage/TopPrimaryButton.graphql"
|
|
import { ContentSidebar_ContentPage } from "../../Fragments/Sidebar/Content.graphql"
|
|
import { DynamicContentSidebar_ContentPage } from "../../Fragments/Sidebar/DynamicContent.graphql"
|
|
import { JoinLoyaltyContactSidebar_ContentPage } from "../../Fragments/Sidebar/JoinLoyaltyContact.graphql"
|
|
import { QuickLinksSidebar_ContentPage } from "../../Fragments/Sidebar/QuickLinks.graphql"
|
|
import { ScriptedCardSidebar_ContentPage } from "../../Fragments/Sidebar/ScriptedCard.graphql"
|
|
import { TeaserCardSidebar_ContentPage } from "../../Fragments/Sidebar/TeaserCard.graphql"
|
|
import { System } from "../../Fragments/System.graphql"
|
|
import { Video } from "../../Fragments/Video.graphql"
|
|
|
|
export const GetContentPage = gql`
|
|
query GetContentPage($locale: String!, $uid: String!) {
|
|
content_page(uid: $uid, locale: $locale) {
|
|
hero_image
|
|
hero_video {
|
|
...Video
|
|
}
|
|
title
|
|
header {
|
|
heading
|
|
preamble
|
|
dynamic_content {
|
|
component
|
|
}
|
|
...TopPrimaryButton_ContentPage
|
|
...NavigationLinks_ContentPage
|
|
}
|
|
meeting_package {
|
|
show_widget
|
|
location
|
|
}
|
|
blocks {
|
|
__typename
|
|
}
|
|
sidebar {
|
|
__typename
|
|
...ContentSidebar_ContentPage
|
|
...DynamicContentSidebar_ContentPage
|
|
...JoinLoyaltyContactSidebar_ContentPage
|
|
...ScriptedCardSidebar_ContentPage
|
|
...TeaserCardSidebar_ContentPage
|
|
...QuickLinksSidebar_ContentPage
|
|
}
|
|
system {
|
|
...System
|
|
created_at
|
|
updated_at
|
|
}
|
|
}
|
|
trackingProps: content_page(locale: "en", uid: $uid) {
|
|
url
|
|
}
|
|
}
|
|
${System}
|
|
${TopPrimaryButton_ContentPage}
|
|
${NavigationLinks_ContentPage}
|
|
${ContentSidebar_ContentPage}
|
|
${DynamicContentSidebar_ContentPage}
|
|
${JoinLoyaltyContactSidebar_ContentPage}
|
|
${ScriptedCardSidebar_ContentPage}
|
|
${TeaserCardSidebar_ContentPage}
|
|
${QuickLinksSidebar_ContentPage}
|
|
${Video}
|
|
`
|
|
|
|
export const GetContentPageBlocksBatch1 = gql`
|
|
query GetContentPageBlocksBatch1($locale: String!, $uid: String!) {
|
|
content_page(uid: $uid, locale: $locale) {
|
|
blocks {
|
|
__typename
|
|
...Accordion_ContentPage
|
|
...CardsGrid_ContentPage
|
|
...Content_ContentPage
|
|
...DynamicContent_ContentPage
|
|
...Jotform_ContentPage
|
|
...VideoCard_ContentPage
|
|
...Video_ContentPage
|
|
}
|
|
}
|
|
}
|
|
${Accordion_ContentPage}
|
|
${CardsGrid_ContentPage}
|
|
${Content_ContentPage}
|
|
${DynamicContent_ContentPage}
|
|
${Jotform_ContentPage}
|
|
${VideoCard_ContentPage}
|
|
${Video_ContentPage}
|
|
`
|
|
|
|
export const GetContentPageBlocksBatch2 = gql`
|
|
query GetContentPageBlocksBatch2($locale: String!, $uid: String!) {
|
|
content_page(uid: $uid, locale: $locale) {
|
|
blocks {
|
|
__typename
|
|
...HotelListing_ContentPage
|
|
...Shortcuts_ContentPage
|
|
...Table_ContentPage
|
|
...TextCols_ContentPage
|
|
...UspGrid_ContentPage
|
|
}
|
|
}
|
|
}
|
|
${HotelListing_ContentPage}
|
|
${Shortcuts_ContentPage}
|
|
${Table_ContentPage}
|
|
${TextCols_ContentPage}
|
|
${UspGrid_ContentPage}
|
|
`
|
|
|
|
export const GetDaDeEnUrlsContentPage = gql`
|
|
query GetDaDeEnUrlsContentPage($uid: String!) {
|
|
de: content_page(locale: "de", uid: $uid) {
|
|
url
|
|
}
|
|
en: content_page(locale: "en", uid: $uid) {
|
|
url
|
|
}
|
|
da: content_page(locale: "da", uid: $uid) {
|
|
url
|
|
}
|
|
}
|
|
`
|
|
|
|
export const GetFiNoSvUrlsContentPage = gql`
|
|
query GetFiNoSvUrlsContentPage($uid: String!) {
|
|
fi: content_page(locale: "fi", uid: $uid) {
|
|
url
|
|
}
|
|
no: content_page(locale: "no", uid: $uid) {
|
|
url
|
|
}
|
|
sv: content_page(locale: "sv", uid: $uid) {
|
|
url
|
|
}
|
|
}
|
|
`
|