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
97 lines
2.4 KiB
TypeScript
97 lines
2.4 KiB
TypeScript
import { gql } from "graphql-tag"
|
|
|
|
import { CardsGrid_LoyaltyPage } from "../../Fragments/Blocks/CardsGrid.graphql"
|
|
import { Content_LoyaltyPage } from "../../Fragments/Blocks/Content.graphql"
|
|
import { DynamicContent_LoyaltyPage } from "../../Fragments/Blocks/DynamicContent.graphql"
|
|
import { Shortcuts_LoyaltyPage } from "../../Fragments/Blocks/Shortcuts.graphql"
|
|
import { ContentSidebar_LoyaltyPage } from "../../Fragments/Sidebar/Content.graphql"
|
|
import { DynamicContentSidebar_LoyaltyPage } from "../../Fragments/Sidebar/DynamicContent.graphql"
|
|
import { JoinLoyaltyContactSidebar_LoyaltyPage } from "../../Fragments/Sidebar/JoinLoyaltyContact.graphql"
|
|
import { System } from "../../Fragments/System.graphql"
|
|
|
|
export const GetLoyaltyPage = gql`
|
|
query GetLoyaltyPage($locale: String!, $uid: String!) {
|
|
loyalty_page(uid: $uid, locale: $locale) {
|
|
heading
|
|
hero_image
|
|
preamble
|
|
title
|
|
blocks {
|
|
__typename
|
|
...CardsGrid_LoyaltyPage
|
|
...Content_LoyaltyPage
|
|
...DynamicContent_LoyaltyPage
|
|
...Shortcuts_LoyaltyPage
|
|
}
|
|
sidebar {
|
|
__typename
|
|
...ContentSidebar_LoyaltyPage
|
|
...DynamicContentSidebar_LoyaltyPage
|
|
...JoinLoyaltyContactSidebar_LoyaltyPage
|
|
}
|
|
system {
|
|
...System
|
|
created_at
|
|
updated_at
|
|
}
|
|
}
|
|
trackingProps: loyalty_page(locale: "en", uid: $uid) {
|
|
url
|
|
}
|
|
}
|
|
${System}
|
|
${CardsGrid_LoyaltyPage}
|
|
${Content_LoyaltyPage}
|
|
${DynamicContent_LoyaltyPage}
|
|
${Shortcuts_LoyaltyPage}
|
|
${ContentSidebar_LoyaltyPage}
|
|
${DynamicContentSidebar_LoyaltyPage}
|
|
${JoinLoyaltyContactSidebar_LoyaltyPage}
|
|
`
|
|
|
|
export const GetDaDeEnUrlsLoyaltyPage = gql`
|
|
query GetDaDeEnUrlsLoyaltyPage($uid: String!) {
|
|
de: loyalty_page(locale: "de", uid: $uid) {
|
|
web {
|
|
original_url
|
|
}
|
|
url
|
|
}
|
|
en: loyalty_page(locale: "en", uid: $uid) {
|
|
web {
|
|
original_url
|
|
}
|
|
url
|
|
}
|
|
da: loyalty_page(locale: "da", uid: $uid) {
|
|
web {
|
|
original_url
|
|
}
|
|
url
|
|
}
|
|
}
|
|
`
|
|
|
|
export const GetFiNoSvUrlsLoyaltyPage = gql`
|
|
query GetFiNoSvUrlsLoyaltyPage($uid: String!) {
|
|
sv: loyalty_page(locale: "sv", uid: $uid) {
|
|
web {
|
|
original_url
|
|
}
|
|
url
|
|
}
|
|
no: loyalty_page(locale: "no", uid: $uid) {
|
|
web {
|
|
original_url
|
|
}
|
|
url
|
|
}
|
|
fi: loyalty_page(locale: "fi", uid: $uid) {
|
|
web {
|
|
original_url
|
|
}
|
|
url
|
|
}
|
|
}
|
|
`
|