Skip to content
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

Ensure compatibility with Typescript integrated in vscode #30

Open
ntziolis opened this issue Oct 31, 2017 · 4 comments
Open

Ensure compatibility with Typescript integrated in vscode #30

ntziolis opened this issue Oct 31, 2017 · 4 comments

Comments

@ntziolis
Copy link

ntziolis commented Oct 31, 2017

Right now the plugin does not work when used without installing as a dev dependency and referencing the tsserver to use the local version.

I have already excluded version conflicts by testing:

Does work:

  • 2.5.3 (dev dependency)

Does not work:

  • 2.5.3 (vscode build in) no intellisene in gql tags

No changes were made to project or package.json in the meanwhile. You can easily repro it by downloading your project and remove the workspace setting.

Since this doesn't seem to be a version issue, any idea why this breaks?

@ntziolis ntziolis changed the title Ensure compatibility with Typescript 2.4 & 2.5 Ensure compatibility with Typescript integrated in vscode Oct 31, 2017
@Quramy
Copy link
Owner

Quramy commented Nov 6, 2017

🤔 It seems that VSC bundled TypeScript can't resolve locally installed plugins. I think it's not this plugin's issue but VSC bundled TypeScript's module resolution issue...

BTW, I recommend to install typescript into your project as devDependency.

@inakianduaga
Copy link

@Quramy After running into this same issue and modifying vscode to use local TS installation (2.5.3) I'm getting the plugin to load successfully on the tsserver logs (and parsing the graphql schema file). However, I'm seeing no errors in vscode when I introduce typos in the gql query (also no autocompletion or anything). Any hints what I should look for? Something in the tsserver logs?

@ntziolis
Copy link
Author

@inakianduaga after configuring a local TS version you need to tell vcsode to actually use it. Open command bar in vscode and execute TypeScript: Restart TS Server and choose your work space version when it asks you to choose.

Note: I'm still not getting errors in TS Server log but i do get autocompletion in gql tags after pressing ctrl+space.. That said its well worth the setup hassle first time as it speeds up development significantly especially when combined with auto generating models + access code for those queries

@debagger
Copy link

debagger commented Jan 9, 2022

Install ts localy and swith vscode to it works for me. Big thanks for comments!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants