Fixed type
This commit is contained in:
@@ -20,6 +20,8 @@ export default async function fetchGraphqlApi<Q, V = any>(
|
||||
}),
|
||||
})
|
||||
|
||||
// console.log('HEADERS', getRawHeaders(res))
|
||||
|
||||
const json = await res.json()
|
||||
if (json.errors) {
|
||||
console.error(json.errors)
|
||||
@@ -27,3 +29,13 @@ export default async function fetchGraphqlApi<Q, V = any>(
|
||||
}
|
||||
return json.data
|
||||
}
|
||||
|
||||
function getRawHeaders(res: Response) {
|
||||
const headers: { [key: string]: string } = {}
|
||||
|
||||
res.headers.forEach((value, key) => {
|
||||
headers[key] = value
|
||||
})
|
||||
|
||||
return headers
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user