Merged in feat/support-for-all-page-links (pull request #1212)

Feat/support for all page links

* feat: added all page link connections to queries

* feat: updated output files


Approved-by: Fredrik Thorsson
Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-01-27 11:21:37 +00:00
parent 527e691157
commit bf76c6277f
51 changed files with 1080 additions and 590 deletions

View File

@@ -1,20 +1,14 @@
import { z } from "zod"
import { Lang } from "@/constants/languages"
import * as pageLinks from "@/server/routers/contentstack/schemas/pageLinks"
import { linkRefsUnionSchema, linkUnionSchema } from "../../schemas/pageLinks"
import { systemSchema } from "../../schemas/system"
const pageConnection = z.object({
edges: z.array(
z.object({
node: z.discriminatedUnion("__typename", [
pageLinks.accountPageSchema,
pageLinks.contentPageSchema,
pageLinks.loyaltyPageSchema,
pageLinks.collectionPageSchema,
pageLinks.hotelPageSchema,
]),
node: linkUnionSchema,
})
),
})
@@ -22,13 +16,7 @@ const pageConnection = z.object({
const pageConnectionRefs = z.object({
edges: z.array(
z.object({
node: z.discriminatedUnion("__typename", [
pageLinks.accountPageRefSchema,
pageLinks.contentPageRefSchema,
pageLinks.loyaltyPageRefSchema,
pageLinks.collectionPageRefSchema,
pageLinks.hotelPageRefSchema,
]),
node: linkRefsUnionSchema,
})
),
})