When I call the API it gives a CORS error on the go. why is this happening
You need to add a mode: ‘cors’ attribute inside the API callback function
I’ve already added it
const response2 = await axios.post(Bitquery.endpoint, {
query: `
{
ethereum(network: bsc) {
dexTrades(
options: {asc: "timeInterval.minute"}
date: {since: "2021-06-20T07:23:21.000Z", till: "${new Date().toISOString()}"}
exchangeAddress: {is: "0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73"}
baseCurrency: {is: "${baseCurrency}"},
quoteCurrency: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"},
tradeAmountUsd: {gt: 10}
)
{
timeInterval {
minute(count: 15, format: "%Y-%m-%dT%H:%M:%SZ")
}
volume: quoteAmount
high: quotePrice(calculate: maximum)
low: quotePrice(calculate: minimum)
open: minimum(of: block, get: quote_price)
close: maximum(of: block, get: quote_price)
}
}
}
`,
variables: {
"from": new Date("2021-06-20T07:23:21.000Z").toISOString(),
"to": new Date("2021-06-23T15:23:21.000Z").toISOString(),
"interval": Number(resolution),
"tokenAddress": symbolInfo.ticker
},
mode: 'cors',
headers: {
"Content-Type": "application/json",
"X-API-KEY": "BQYyGwlM3uQRKbNrPS01UwFpoDHrTaEq"
}
})
but the problem remains
did u fix ?did u fix ?did u fix ?did u fix ?did u fix ?did u fix ?did u fix ?did u fix ?did u fix ?did u fix ?did u fix ?did u fix ?
Having the same issue, did you manage to fix it?