apollographql / apollographql/vscode-graphql

Go to Definition doesn't work in GraphQL schema file

Open
#58 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
78
Forks
23
PR merge metrics
No merged PRs in 30d

Description

In our repo https://github.com/CMSgov/easi-app, we have a client project with a local schema file, with [this apollo.config.js](https://github.com/CMSgov/easi-app/blob/master/apollo.config.js). When `pkg/graph/schema.graphql` is open, the Go to Definition action doesn't work on types defined in the schema; it shows "No definition found", even for types that are definitely defined in the schema file.

With the `apollographql.trace.server` setting on `verbose`, the following messages are displayed - it looks like the language server isn't returning any responses for `textDocument/definition` requests.

```
[Trace - 9:44:21 AM] Sending request 'textDocument/definition - (14)'.
Params: {
"textDocument": {
"uri": "file:///home/dylan/source/repos/easi-app/pkg/graph/schema.graphql"
},
"position": {
"line": 1095,
"character": 53
}
}

[Trace - 9:44:21 AM] Received response 'textDocument/definition - (14)' in 1ms.
No result returned.
```

┆Issue is synchronized with this [Jira Task](https://apollographql.atlassian.net/browse/NEBULA-853) by [Unito](https://www.unito.io)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by opening apollo.config.js and pkg/graph/schema.graphql from the linked reproduction repository, then reproduce Go to Definition with apollographql.trace.server set to verbose. Inspect the textDocument/definition request and response for a schema type. Done means the request returns a definition location instead of no result.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.