fix: add apiResponse.text() to logging

This commit is contained in:
Arvid Norlin
2024-08-23 08:36:14 +02:00
committed by Michael Zetterberg
parent 7cd6367c15
commit 9497e8eef3
6 changed files with 86 additions and 26 deletions

View File

@@ -46,10 +46,10 @@ export async function request<T>(
}
}
const print = (await import("graphql/language/printer")).print
const nr = Math.random()
console.log(`START REQUEST ${nr}`)
console.time(`OUTGOING REQUEST ${nr}`)
// const print = (await import("graphql/language/printer")).print
// const nr = Math.random()
// console.log(`START REQUEST ${nr}`)
// console.time(`OUTGOING REQUEST ${nr}`)
// console.log(`Sending reqeust to ${env.CMS_URL}`)
// console.log(`Query:`, print(query as DocumentNode))
// console.log(`Variables:`, variables)
@@ -63,7 +63,7 @@ export async function request<T>(
variables,
})
console.timeEnd(`OUTGOING REQUEST ${nr}`)
// console.timeEnd(`OUTGOING REQUEST ${nr}`)
// console.log({ response })
return { data: response }