graphql / vscode-graphql

MIGRATED: VSCode GraphQL extension (autocompletion, go-to definition, syntax highlighting)
https://marketplace.visualstudio.com/items?itemName=Prisma.vscode-graphql
MIT License
557 stars 71 forks source link

Adds condition to only create a ws client when executing a subscription operation #361

Closed edusig closed 2 years ago

edusig commented 2 years ago

Fix #360

linux-foundation-easycla[bot] commented 2 years ago

CLA Signed

The committers are authorized under a signed CLA.

acao commented 2 years ago

thank you!

acao commented 2 years ago

Otherwise, do things seem ok overall with the client upgrade/refactor?

edusig commented 2 years ago

I started using this extension yesterday so I can't say much about the upgrade/refactor. I haven't tested a subscription operation yet, but this PR should only fix for query and mutation.

The only problem I still have is that, even though I configured my workspace to change the base path for the GraphQL config file, it still wouldn't find it. This sucks because I work a lot with monorepos and use graphql-code-generator, so right now I have to maintain 2 separate GraphQL config files.

acao commented 2 years ago

Huh, that does suck. We have some open bugs for adding vscode multi-root workspaces support that we need to resolve, as we never adopted that feature when vscode introduced it a long time ago.

Currently the language server expects one graphql config file as graphql-config expects, so we need to update the language service cacheing strategy to support multiple graphql config instances for each config file in each workspace

there may also be outstanding bugs with the custom load.basePath, the unit tests for that are in the server and don’t test many cases