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
87 lines
2.4 KiB
TypeScript
87 lines
2.4 KiB
TypeScript
import { gql } from "graphql-tag"
|
|
|
|
import { CardsGrid_CollectionPage } from "../../Fragments/Blocks/CardsGrid.graphql"
|
|
import { DynamicContent_CollectionPage } from "../../Fragments/Blocks/DynamicContent.graphql"
|
|
import { Shortcuts_CollectionPage } from "../../Fragments/Blocks/Shortcuts.graphql"
|
|
import { UspGrid_CollectionPage } from "../../Fragments/Blocks/UspGrid.graphql"
|
|
import { VideoCard_CollectionPage } from "../../Fragments/Blocks/VideoCard.graphql"
|
|
import { NavigationLinks_CollectionPage } from "../../Fragments/CollectionPage/NavigationLinks.graphql"
|
|
import { TopPrimaryButton_CollectionPage } from "../../Fragments/CollectionPage/TopPrimaryButton.graphql"
|
|
import { System } from "../../Fragments/System.graphql"
|
|
import { Video } from "../../Fragments/Video.graphql"
|
|
|
|
export const GetCollectionPage = gql`
|
|
query GetCollectionPage($locale: String!, $uid: String!) {
|
|
collection_page(uid: $uid, locale: $locale) {
|
|
hero_image
|
|
hero_video {
|
|
...Video
|
|
}
|
|
title
|
|
header {
|
|
heading
|
|
preamble
|
|
...TopPrimaryButton_CollectionPage
|
|
...NavigationLinks_CollectionPage
|
|
}
|
|
meeting_package {
|
|
show_widget
|
|
location
|
|
}
|
|
blocks {
|
|
__typename
|
|
...CardsGrid_CollectionPage
|
|
...Shortcuts_CollectionPage
|
|
...UspGrid_CollectionPage
|
|
...DynamicContent_CollectionPage
|
|
...VideoCard_CollectionPage
|
|
}
|
|
system {
|
|
...System
|
|
created_at
|
|
updated_at
|
|
}
|
|
}
|
|
trackingProps: collection_page(locale: "en", uid: $uid) {
|
|
url
|
|
}
|
|
}
|
|
${System}
|
|
${TopPrimaryButton_CollectionPage}
|
|
${NavigationLinks_CollectionPage}
|
|
${CardsGrid_CollectionPage}
|
|
${Shortcuts_CollectionPage}
|
|
${UspGrid_CollectionPage}
|
|
${DynamicContent_CollectionPage}
|
|
${VideoCard_CollectionPage}
|
|
${Video}
|
|
`
|
|
|
|
export const GetDaDeEnUrlsCollectionPage = gql`
|
|
query GetDaDeEnUrlsCollectionPage($uid: String!) {
|
|
de: collection_page(locale: "de", uid: $uid) {
|
|
url
|
|
}
|
|
en: collection_page(locale: "en", uid: $uid) {
|
|
url
|
|
}
|
|
da: collection_page(locale: "da", uid: $uid) {
|
|
url
|
|
}
|
|
}
|
|
`
|
|
|
|
export const GetFiNoSvUrlsCollectionPage = gql`
|
|
query GetFiNoSvUrlsCollectionPage($uid: String!) {
|
|
fi: collection_page(locale: "fi", uid: $uid) {
|
|
url
|
|
}
|
|
no: collection_page(locale: "no", uid: $uid) {
|
|
url
|
|
}
|
|
sv: collection_page(locale: "sv", uid: $uid) {
|
|
url
|
|
}
|
|
}
|
|
`
|