graphql / vscode-graphql

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

Go To Definition No Longer works #63

Closed tomitrescak closed 2 years ago

tomitrescak commented 6 years ago

I am not sure if this is misconfiguration on my side, but Go To Definition No longer works for me. I tried on several projects on different computers and it is the case.

One repro is here:

https://github.com/tomitrescak/corporator

Do you have some test project where it works? Thanks

[EDIT] I have just downloaded your project "graphql-server-example", No luck there. Is it maybe error in the latest visual studio code? I did not try to downgrade yet.

tomitrescak commented 6 years ago

Would you please confirm whether this is broken so I can maybe try to fix it, or is it problem of my configuration? Maybe some bad global dependencies?

Current:

Prisma: prisma/1.14.2 (darwin-x64) node-v10.9.0 Graphql: 2.16.5

chanlito commented 6 years ago

@tomitrescak mine isn't working either.

oviava commented 6 years ago

Confirming - same issue, worth mentioning running on code-insiders. quadruple checked the graphql config files, paths, schemas

tomitrescak commented 6 years ago

@divyenduz you mention "Needs Reproduction", but I mentioned two repos where it does not work. You can just try the following one:

https://github.com/prisma/graphql-server-example

Thanks for looking into this. The plugin is otherwise spectacular!

dontsave commented 6 years ago

I'm running into the same issue with a Gatsby (graphql) project as well.

chanlito commented 6 years ago

It'd be nice if somebody could look into this issue.

divyenduz commented 6 years ago

Thanks all for the feedback. Can any of you please share the logs for GraphQL Language Service? From your environment: https://github.com/prisma/vscode-graphql#a-testinglogging-graphql-language-features

chanlito commented 6 years ago

Ok so I followed the instructions here's what my log shows:

screen shot 2018-11-05 at 10 50 23 pm

Which to me makes absolutely no sense, and how is it related to Go to definition not working.

divyenduz commented 5 years ago

@chanlito : It looks like you have the same fields on mutation type (maybe you are using schema stitching or something or maybe it is a multi-repo project - extension cannot tell if different files belong to different projects, if they have duplicates).

This fails extendSchema from graphql-js being used by the graphql-language-service.

Here is an example of how this might be going wrong: https://codesandbox.io/s/34lvxl4pn1

Posted this information here for anyone who might attempt a fix for this. This might require big changes in the language service.