Skip to content

Other Editors

GraphQL Analyzer’s LSP server works with any editor that supports the Language Server Protocol.

  1. Install the graphql-lsp binary (see Installation)
  2. Configure your editor’s LSP client to:
    • Launch graphql-lsp as the server command
    • Communicate via stdin/stdout
    • Associate it with GraphQL file types (.graphql, .gql)
    • Optionally associate it with TypeScript/JavaScript for embedded GraphQL
    • Set the root directory to where .graphqlrc is located

The server supports:

  • textDocument/didOpen — Load and validate
  • textDocument/didChange — Incremental updates
  • textDocument/didClose — Clean up
  • textDocument/didSave — Re-validate
  • textDocument/definition — Go to definition
  • textDocument/references — Find references
  • textDocument/hover — Hover information
  • textDocument/completion — Autocomplete fields, fragments, types
  • textDocument/signatureHelp — Argument signatures
  • textDocument/publishDiagnostics — Real-time errors
  • textDocument/documentSymbol — Document outline
  • workspace/symbol — Workspace-wide symbol search
  • textDocument/semanticTokens — Semantic highlighting
  • textDocument/codeLens — Inline code information
  • textDocument/foldingRange — Code folding
  • textDocument/inlayHint — Inline type hints
  • textDocument/selectionRange — Smart selection expansion
  • textDocument/rename — Rename symbols
  • textDocument/codeAction — Quick fixes
  • workspace/didChangeWatchedFiles — React to file changes
  • workspace/executeCommand — Execute server-side commands
Terminal window
# Standard mode (stdin/stdout)
graphql-lsp
# With debug logging
RUST_LOG=debug graphql-lsp 2> lsp.log

Add to languages.toml:

[[language]]
name = "graphql"
language-servers = ["graphql-lsp"]
[language-server.graphql-lsp]
command = "graphql-lsp"

Zed has built-in LSP support. Add to your settings:

{
"lsp": {
"graphql-lsp": {
"binary": {
"path": "graphql-lsp"
}
}
}
}