Skip to content

Commit

Permalink
refactor: typo bathching -> batching (#425)
Browse files Browse the repository at this point in the history
  • Loading branch information
purefan authored Jan 10, 2023
1 parent 973bfd7 commit d7d0a8d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ async function makeRequest<T = any, V extends Variables = Variables>({
middleware?: RequestMiddleware<V>
}): Promise<Response<T>> {
const fetcher = method.toUpperCase() === 'POST' ? post : get
const isBathchingQuery = Array.isArray(query)
const isBatchingQuery = Array.isArray(query)

const response = await fetcher({
url,
Expand All @@ -477,7 +477,7 @@ async function makeRequest<T = any, V extends Variables = Variables>({
const result = await getResult(response, fetchOptions.jsonSerializer)

const successfullyReceivedData =
isBathchingQuery && Array.isArray(result) ? !result.some(({ data }) => !data) : !!result.data
isBatchingQuery && Array.isArray(result) ? !result.some(({ data }) => !data) : !!result.data

const successfullyPassedErrorPolicy =
!result.errors || fetchOptions.errorPolicy === 'all' || fetchOptions.errorPolicy === 'ignore'
Expand All @@ -489,7 +489,7 @@ async function makeRequest<T = any, V extends Variables = Variables>({
const data = fetchOptions.errorPolicy === 'ignore' ? rest : result

return {
...(isBathchingQuery ? { data } : data),
...(isBatchingQuery ? { data } : data),
headers,
status,
}
Expand Down

0 comments on commit d7d0a8d

Please sign in to comment.