Closed covertbert closed 4 years ago
Thanks for raising this issue. I will need to reproduce this. Do you have a small project maybe that I can use to reproduce this?
Unfortunately I don't have a project that I'm able to share, however replicating this should be as simple as the following:
.graphqlconfig
that contains something like this
{
"projects": {
"myProject": {
"schemaPath": "schema.graphql",
"extensions": {
"endpoints": {
"local": {
"url": "http://localhost:8000/app_dev.php/graphql",
"headers": {
"Authorization": "Bearer ${env:API_TOKEN}"
}
}
}
}
}
}
}
API_TOKEN
via export API_TOKEN=xxxx
in the command line.Apologies as I know this will still need quite a lot of set up on your part to replicate!
@covertbert with the graphql-config@3.0.0
upgrade, you'll be able to use commonjs files, so you'll be able to do:
const { API_TOKEN } = process.env
module.exports = {
projects: {
myProject: {
schema: "schema.graphql",
extensions: {
endpoints: {
local: {
url: "http://localhost:8000/app_dev.php/graphql",
headers: {
Authorization: `Bearer ${API_TOKEN}`
}
}
}
}
}
}
}
prisma.vscode-graphql@0.3.1
released! please open new tickets if you have any issues
Our
.graphqlconfig
references API tokens that are set in this manner"Authorization": "Bearer ${env:API_TOKEN}"
withAPI_TOKEN
being a token that changes regularly and is set viaexport API_TOKEN=
in a shell.Is there any way we can get this extension to authenticate properly so we can use the "execute query/mutation" features etc? Currently, of course, it will just say "API_TOKEN is not set"