feat: add edge request function

This commit is contained in:
Christel Westerberg
2024-06-03 15:18:00 +02:00
parent f9acabce1f
commit 74b05ed6a0
11 changed files with 122 additions and 95 deletions

View File

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