Closed mdreizin closed 2 years ago
Is there any update on this? I've been trying to do this with a project and it keeps throwing me a similar Error message
@mdreizin @aylton-almeida this was bugging me too, submitted a fix in #267 but if you want a temp fix you can patch it:
open the installed extension's extension.js
file (somewhere like ~/.vscode/extensions/graphql.vscode-graphql-0.3.13/out/extension.js
and add this patch around line 30 (don't think it really matters where, as long as it's in that fn):
const config = getConfig();
const { debug } = config;
if (debug) {
console.log('Extension "vscode-graphql" is now active!');
}
+ if (vscode_1.workspace.workspaceFolders) {
+ process.chdir(vscode_1.workspace.workspaceFolders[0].uri.fsPath);
+ }
@jkcorrea Cool! Thanks!
the solution is to import dotenv in your .ts or .js config file!
Actual Behavior
Env vars does not work properly even if they are valid.
Expected Behavior
Should be working fine.
Steps to Reproduce the Problem Or Description
.env
fileGRAPHQL_TOKEN=xxx
with a valid valuegraphql.config.js
with the content:If I set the token value manually then it will work:
The following config doesn't work as well:
Specifications
Logs Of TS Server || GraphQL Language Service