feat(SW-237): Cache revalidation support

This commit is contained in:
Hrishikesh Vaipurkar
2024-09-03 13:35:16 +02:00
parent 02da8e8ece
commit a1ee86ea99
4 changed files with 21 additions and 9 deletions

View File

@@ -1,5 +1,4 @@
import { metrics } from "@opentelemetry/api"
import { ValueOf } from "next/dist/shared/lib/constants"
import { GetContactConfig } from "@/lib/graphql/Query/ContactConfig.graphql"
import {
@@ -14,11 +13,7 @@ import { request } from "@/lib/graphql/request"
import { notFound } from "@/server/errors/trpc"
import { contentstackBaseProcedure, router } from "@/server/trpc"
import {
generateRefsResponseTag,
generateRefTag,
generateTag,
} from "@/utils/generateTag"
import { generateRefsResponseTag, generateTag } from "@/utils/generateTag"
import { langInput } from "./input"
import {
@@ -33,8 +28,6 @@ import {
validateHeaderConfigSchema,
} from "./output"
import { ContentTypeEnum } from "@/types/requests/contentType"
const meter = metrics.getMeter("trpc.contentstack.base")
// OpenTelemetry metrics: ContactConfig
const getContactConfigCounter = meter.createCounter(

View File

@@ -16,6 +16,7 @@ import {
validateBookingWidgetToggleSchema,
ValidateBookingWidgetToggleType,
} from "./output"
import { affix as bookingwidgetAffix } from "./utils"
import { ContentTypeEnum } from "@/types/requests/contentType"
@@ -65,7 +66,7 @@ export const bookingwidgetQueryRouter = router({
},
{
next: {
tags: [generateTag(lang, uid, "bookingwidget")],
tags: [generateTag(lang, uid, bookingwidgetAffix)],
},
}
)

View File

@@ -0,0 +1 @@
export const affix = "bookingwidget"