fix: rename retried-wrapped fetch to make caching work again

This commit is contained in:
Simon Emanuelsson
2024-08-28 10:47:57 +02:00
parent 08529e6398
commit 93526ce693
41 changed files with 728 additions and 575 deletions

View File

@@ -2,15 +2,22 @@ import { Lang } from "@/constants/languages"
import { request } from "@/lib/graphql/request"
import { internalServerError, notFound } from "@/server/errors/trpc"
import { generateTag } from "@/utils/generateTag"
import { getMetaDataSchema, Page } from "./output"
export type Variables = {
locale: Lang
url: string
uid: string
}
export async function getResponse<T>(query: string, variables: Variables) {
const response = await request<T>(query, variables)
const response = await request<T>(query, variables, {
cache: "force-cache",
next: {
tags: [generateTag(variables.locale, variables.uid)],
},
})
if (!response.data) {
throw notFound(response)
}