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

@@ -68,7 +68,10 @@ export type Variables = {
export async function getRefsResponse<T>(query: string, variables: Variables) {
const refsResponse = await request<T>(query, variables, {
tags: [generateRefsResponseTag(variables.locale, variables.url, affix)],
cache: "force-cache",
next: {
tags: [generateRefsResponseTag(variables.locale, variables.url, affix)],
},
})
if (!refsResponse.data) {
throw notFound(refsResponse)
@@ -89,7 +92,10 @@ export async function getResponse<T>(
variables: Variables,
tags: string[]
) {
const response = await request<T>(query, variables, { tags })
const response = await request<T>(query, variables, {
cache: "force-cache",
next: { tags },
})
if (!response.data) {
throw notFound(response)
}