apollographql / apollographql/apollo-tooling

Apollo vscode extension goto definition not working

Open
#1,682 2 comments 11 reactions 0 assignees View on GitHub
:spiral_notepad: component - vscode
Dominant language
TypeScript
Stars
3k
Forks
460
PR merge metrics
No merged PRs in 30d

Description

When project is configured as "client" and schema is provided via `localSchemaFile` config property.

**Intended outcome:**
Autocompletion, syntax highlighting and goto definition is working.

**Actual outcome:**
Autocompletion and syntax highlighting are working but goto definition is not working since apollo-language-server is returning `"uri": "GraphQL request"` as file location although line number in response is correct. This is not happening if schema is specified via remote url.

**How to reproduce the issue:**

**Versions**
apollographql.vscode-apollo 1.12.1

Additionally, I can make autocompletion or goto functionality work for server/service repository.
Note: my project is set up as monorepo and I have apollo.config.js in both client/ and server/ folders.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in the monorepo setup with apollo.config.js in both client/ and server/, using client configuration with localSchemaFile. Start by tracing the apollo-language-server response and the VS Code extension's goto-definition handling, then compare it with the remote-URL case. Done means goto definition resolves to the local schema file rather than "GraphQL request".

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.