-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apollo-vscode: Cannot use local schema file #669
Comments
When I take a look at this source code here:
Looks like the module.exports = {
client: {
service: {
localSchemaFile: './internals/schema.graphql',
endpoint: null
},
includes: [
"client/src/**/*.{ts,tsx,js,jsx,graphql}"
]
}
}; Replace Also, apollo.config.js must be located in your project root (as seen by vscode). |
Same problem here. I tried it with |
@jpaas @jessedvrs I did a little more digging into the whole codebase and determined it is definitely a bug. Came up with a PR #676 to solve this :) |
EDIT: Never mind, it was fixed after VScode restart... @stnwk this error still happens for me! My config: module.exports = {
client: {
service: {
name: 'MYGQL',
localSchemaFile: './src/generated/graphql.schema.json',
includes: ['src/**/*.{graphql,ts,js}'],
excludes: ['**/node_modules/**'],
},
},
}; Error: I'm using latest VSCode plugin Apollo GraphQL |
Had the same problem, needed to fully restart VSCode after editing the apollo.config.js. Adding My config: module.exports = {
client: {
service: {
name: 'consumer-app',
localSchemaFile: './schema.graphql'
},
includes: ['src/**/*.gql', 'src/**/*.ts', 'src/**/*.tsx']
}
} |
@ktsosno are you saying you're still having this problem after a restart? You shouldn't have needed to restart vscode after a config change. That should've been fixed a while back. Can you make sure you're up to date on the extension if so? |
I use this config file in a multi root workspace, and I definitely sure, the file path is correct, but still got this error:
|
@kazinad I can confirm using a local schema doesn't work for me within workspaces, but does work when I run a project on its own. |
@aaronmcadam that should be possible to quick-fix via constructing path programmatically with
This works, because |
Thanks for this @joltmode, but I now use graphql-codegen for this tooling instead. This makes sense though, I think this might be useful for other tools inside workspaces, thanks! |
module.exports = {
client: {
name: 'graphql-vscode-client-test',
service: {
localSchemaFile: 'schema.graphql',
},
},
}; This config is working for me |
@kaushal-aubie thank you for sharing what's working for you, but this issue is closed and over 3 years old. Please use good judgement when commenting on issues. Everyone on this thread receives an (almost certainly) unwanted notification. |
Hi everyone!
I was just trying to figure out how to configure the new VSCode Extension, but I simply couldn't manage to do so.
That's my situation:
How do I successfully configure this in my
apollo.config.js
? I've tried everything but somehow it never works.^ This config does not output anything in the debug view.
^ This config outputs
TypeError: Only absolute URLs are supported
- welpAdditionally I receive the following error although I don't wan't to use the Apollo Engine related stuff..
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Unable to find ENGINE_API_KEY
Can someone help me? The docs weren't really helpful about this :(
Might be related to #667 ?
The text was updated successfully, but these errors were encountered: