Merged in feat/rework-contentstack (pull request #3493)
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
This commit is contained in:
@@ -1,19 +1,10 @@
|
||||
import { gql } from "graphql-tag"
|
||||
|
||||
import {
|
||||
Accordion_CampaignPage,
|
||||
Accordion_CampaignPageRefs,
|
||||
} from "../../Fragments/Blocks/Accordion.graphql"
|
||||
import {
|
||||
CarouselCards_CampaignPage,
|
||||
CarouselCards_CampaignPageRefs,
|
||||
} from "../../Fragments/Blocks/CarouselCards.graphql"
|
||||
import { Accordion_CampaignPage } from "../../Fragments/Blocks/Accordion.graphql"
|
||||
import { CarouselCards_CampaignPage } from "../../Fragments/Blocks/CarouselCards.graphql"
|
||||
import { Essentials_CampaignPage } from "../../Fragments/Blocks/Essentials.graphql"
|
||||
import { HotelListing_CampaignPage } from "../../Fragments/Blocks/HotelListing.graphql"
|
||||
import {
|
||||
Hero_CampaignPage,
|
||||
HeroRef_CampaignPage,
|
||||
} from "../../Fragments/CampaignPage/Hero.graphql"
|
||||
import { Hero_CampaignPage } from "../../Fragments/CampaignPage/Hero.graphql"
|
||||
import { CampaignPageIncludedHotels } from "../../Fragments/CampaignPage/IncludedHotels.graphql"
|
||||
import { System } from "../../Fragments/System.graphql"
|
||||
|
||||
@@ -61,26 +52,6 @@ export const GetCampaignPage = gql`
|
||||
${Hero_CampaignPage}
|
||||
`
|
||||
|
||||
export const GetCampaignPageRefs = gql`
|
||||
query GetCampaignPageRefs($locale: String!, $uid: String!) {
|
||||
campaign_page(locale: $locale, uid: $uid) {
|
||||
blocks {
|
||||
__typename
|
||||
...CarouselCards_CampaignPageRefs
|
||||
...Accordion_CampaignPageRefs
|
||||
}
|
||||
...HeroRef_CampaignPage
|
||||
system {
|
||||
...System
|
||||
}
|
||||
}
|
||||
}
|
||||
${System}
|
||||
${CarouselCards_CampaignPageRefs}
|
||||
${Accordion_CampaignPageRefs}
|
||||
${HeroRef_CampaignPage}
|
||||
`
|
||||
|
||||
export const GetDaDeEnUrlsCampaignPage = gql`
|
||||
query GetDaDeEnUrlsCampaignPage($uid: String!) {
|
||||
de: campaign_page(locale: "de", uid: $uid) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { gql } from "graphql-tag"
|
||||
|
||||
import { Hero_CampaignPage } from "../../Fragments/CampaignPage/Hero.graphql"
|
||||
import { CampaignPageRef } from "../../Fragments/CampaignPage/Ref.graphql"
|
||||
import { System } from "../../Fragments/System.graphql"
|
||||
|
||||
export const GetCampaignPagesByHotelUid = gql`
|
||||
@@ -47,35 +46,3 @@ export const GetCampaignPagesByHotelUid = gql`
|
||||
${System}
|
||||
${Hero_CampaignPage}
|
||||
`
|
||||
|
||||
export const GetCampaignPagesByHotelUidRefs = gql`
|
||||
query GetCampaignPagesByHotelUidRefs(
|
||||
$locale: String!
|
||||
$hotelPageUid: String!
|
||||
$today: DateTime!
|
||||
) {
|
||||
all_campaign_page(
|
||||
where: {
|
||||
OR: [
|
||||
{
|
||||
included_hotels: { list_1: { hotel_page: { uid: $hotelPageUid } } }
|
||||
}
|
||||
{
|
||||
included_hotels: { list_2: { hotel_page: { uid: $hotelPageUid } } }
|
||||
}
|
||||
]
|
||||
AND: [
|
||||
{ OR: [{ startdate: null }, { startdate_lte: $today }] }
|
||||
{ OR: [{ enddate: null }, { enddate_gte: $today }] }
|
||||
]
|
||||
}
|
||||
locale: $locale
|
||||
limit: 100
|
||||
) {
|
||||
items {
|
||||
...CampaignPageRef
|
||||
}
|
||||
}
|
||||
}
|
||||
${CampaignPageRef}
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user