fix: rename retried-wrapped fetch to make caching work again
This commit is contained in:
@@ -14,20 +14,20 @@ const client = new GraphQLClient(env.CMS_URL, {
|
||||
url: URL | RequestInfo,
|
||||
params: RequestInit | undefined
|
||||
) {
|
||||
const fetch = fetchRetry(global.fetch, {
|
||||
const wrappedFetch = fetchRetry(global.fetch, {
|
||||
retries: 3,
|
||||
retryDelay: function (attempt, error, response) {
|
||||
return Math.pow(2, attempt) * 150 // 150, 300, 600
|
||||
},
|
||||
})
|
||||
return fetch(url, params)
|
||||
return wrappedFetch(url, params)
|
||||
}),
|
||||
})
|
||||
|
||||
export async function request<T>(
|
||||
query: string | DocumentNode,
|
||||
variables?: {},
|
||||
next?: NextFetchRequestConfig
|
||||
params?: RequestInit
|
||||
): Promise<Data<T>> {
|
||||
return _request(client, query, variables, next)
|
||||
return _request(client, query, variables, params)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user