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

@@ -7,12 +7,12 @@ import type { BatchRequestDocument } from "graphql-request"
import type { Data } from "@/types/request"
export async function batchRequest<T>(
queries: (BatchRequestDocument & NextFetchRequestConfig)[]
queries: (BatchRequestDocument & { options?: RequestInit })[]
): Promise<Data<T>> {
try {
const response = await Promise.allSettled(
queries.map((query) =>
request<T>(query.document, query.variables, { tags: query.tags })
request<T>(query.document, query.variables, query.options)
)
)