graphql / graphiql

GraphiQL & the GraphQL LSP Reference Ecosystem for building browser & IDE tools.
MIT License
16.09k stars 1.72k forks source link

Can't use Go to Definition / Type Definition / Implementation #2337

Open Albert-Gao opened 4 years ago

Albert-Gao commented 4 years ago

Actual Behavior

  1. hover over, get correct definition image
  2. right click, image
  3. select one of them, no blahblah found for tagConnection image

Specifications

GraphQL for VSCode Extension Version: latest from store Version: 1.49.1 Commit: 58bb7b2331731bf72587010e943852e13e6fd3cf Date: 2020-09-16T23:21:17.533Z Electron: 9.2.1 Chrome: 83.0.4103.122 Node.js: 12.14.1 V8: 8.3.110.13-electron.0 OS: Darwin x64 19.6.0

acao commented 4 years ago

you need to make sure that your schema pointers include all schema definitions, including custom scalars, directives, etc. so schema can look like:

schema: ["https://localhost:8080", "./src/customDirectives.graphql", "./src/customDirectives.json"]

either way, it needs to know something about what directives should be available

acao commented 4 years ago

so this is what relay uses to generate it's definitions?

https://github.com/relay-tools/vscode-apollo-relay/blob/master/src/generateDirectivesFile.ts

Albert-Gao commented 4 years ago

Thanks for the reply!

isn't the definition already included, such that, it can be hover-over?

What's not working is the go-to part, what am i missing here? :)

Albert-Gao commented 4 years ago

Thanks, this is what I was missing: image

Thought it's default true.

So, good news is, "Go To Definition" works now, but only to that file, not the line the definition is been defined.

Same thing happens to Peek as well.

image

I can live with it TBH, but just wonder I am not miss anything here?