So, I am using Altair to figure out some queries for getting analytics from Cloudflare GraphQL Analytics endpoint, which works fine, I am including two headers using Altair:
X-Auth-Email Email
Authorization Bearer
Which works fine.
However, when I come to using Apollo in my NuxtJS config:
apollo: {
clients: {
default: {
httpEndpoint: 'https://api.cloudflare.com/client/v4/graphql',
opts: {
headers: {
'X-Auth-Email': 'email',
authorization: 'Bearer mytoken'
}
}
},
}
},
<script>
import gql from 'graphql-tag'
export default {
name: 'IndexPage',
layout: 'index',
apollo: {
analytics: gql `
query getAnalytics {
viewer {
zones(filter: {
zoneTag: "tag"
}) {
httpRequestsAdaptiveGroups(filter: {
clientRequestHTTPHost: "domain.io"
}, limit: 1) {
sum {
visits
}
}
}
}
}
`
}
}
</script>
I am receiving nothing out when I try to get any values from the query.