doomemacs/modules/lang/graphql
Henrik Lissner 680d135062
bump: :lang
50ways2sayhard/dart-ts-mode@ab87873f25 -> 50ways2sayhard/dart-ts-mode@0e42336bf7
JuliaEditorSupport/julia-emacs@aadf29523a -> JuliaEditorSupport/julia-emacs@1478898ea0
agda/agda@5cf984c3d2 -> agda/agda@6310545817
bricka/emacs-kotlin-ts-mode@051c9ef534 -> bricka/emacs-kotlin-ts-mode@b318a64a7f
clojure-emacs/cider@ae247d8845 -> clojure-emacs/cider@75dc57aebe
clojure-emacs/clojure-mode@bddba12e96 -> clojure-emacs/clojure-mode@f44ea50308
clojure-emacs/clojure-ts-mode@96fdffcbe9 -> clojure-emacs/clojure-ts-mode@f47fefb5d7
cpitclaudel/company-coq@78ed04ce39 -> cpitclaudel/company-coq@1fc1d8f2d5
davazp/graphql-mode@ef757c6ce2 -> davazp/graphql-mode@d7f105a4bf
emacs-jupyter/jupyter@de89cbeca8 -> emacs-jupyter/jupyter@242fdc709c
emacs-lsp/lsp-dart@fd82395180 -> emacs-lsp/lsp-dart@166e4f2ba1
emacs-rustic/rustic@cb013cd217 -> emacs-rustic/rustic@eea94386bf
emacs-straight/auctex@1939acb54b -> emacs-straight/auctex@f0c4b1dcc9
erlang/otp@f80e9c1c4a -> erlang/otp@ea2bfd02be
hvesalai/emacs-sbt-mode@cc68728a6e -> hvesalai/emacs-sbt-mode@c353df6aa1
jrblevin/markdown-mode@9de2df5a9f -> jrblevin/markdown-mode@f8d1be7cd5
mekeor/nael@3ee1cf286d -> mekeor/nael@fbfb675736
nix-community/nix-emacs@053a2d5110 -> nix-community/nix-emacs@e241b58c9e
nix-community/nix-ts-mode@625306cf9c -> nix-community/nix-ts-mode@3198317121
ocaml/dune@7a7d49206f -> ocaml/dune@141393af40
ocaml/merlin@1c4148af05 -> ocaml/merlin@fad4a2785c
org-roam/org-roam@b4857fd7a1 -> org-roam/org-roam@7cd906b6f8
polymode/polymode@14b1fd8d2a -> polymode/polymode@4604f55cc0
rust-lang/rust-mode@f68ddca5c2 -> rust-lang/rust-mode@668069ad8b
2026-03-02 19:45:08 -05:00
..
.doommodule feat: add .doommodule files 2024-09-14 20:47:39 -04:00
autoload.el refactor: (if|when)-let -> (if|when)-let* 2025-01-08 19:33:37 -05:00
config.el refactor(:lang): remove fboundp checks for *-ts-modes 2025-09-01 20:11:02 +02:00
doctor.el feat(graphql): add treesit support 2025-08-28 14:32:08 +02:00
packages.el bump: :lang 2026-03-02 19:45:08 -05:00
README.org feat(graphql): add treesit support 2025-08-28 14:32:08 +02:00

:lang graphql

Description   unfold

This module adds GraphQL support to Doom Emacs.

It includes:

  • Code completion
  • LSP support (doom-module:+lsp)

    • Diagnostics (GraphQL syntax linting/validations) (spec-compliant)
    • Autocomplete suggestions (spec-compliant)
    • Hyperlink to fragment definitions and named types (type, input, enum) definitions (spec-compliant)
    • Outline view support for queries and SDL
    • Symbols support across the workspace
  • Local schema viewer
  • Org-babel exporter (requires doom-module::lang org)

Module flags

+lsp
Enable LSP support for graphql-mode. Requires doom-module::tools lsp and a langserver (graphql-language-service-cli).
+tree-sitter
Leverages tree-sitter for better syntax highlighting and structural text editing. Requires doom-module::tools tree-sitter.

Hacks

TODO Changelog

This module does not have a changelog yet.

Installation

Enable this module in your doom! block.

LSP

This module has no direct requirements, but the +lsp flag requires a supported LSP server.

Formatter

Formatting is handled using the doom-module::editor format module via prettier.

Usage

Sending queries

When visiting a graphql buffer, you have access to the ability to send the current query with C-c C-c which will prompt you for an optional variables file, then execute the query and return a buffer of the results.

It's also possible to send queries using org-babel using a block such as the ones below (executing correctly will require :lang org)

{
    "continentCode": "AF"
}
query GetContinents($continentCode: String!) {
  continent(code: $continentCode) {
    name
    code
  }
}
{
  "data": {
    "continent": {
      "name": "Africa",
      "code": "AF"
    }
  }
}

Viewing docs

With this module, there are 3 ways to view schemas:

  • +graphql-doc-open-config which uses a local .graphqlconfig file to seed endpoints to query
  • graphql-doc which prompts you to select an endpoint based on ones added manually by graphql-doc-add-api
  • graphql-doc-open-url which prompts to manually enter an endpoint url

When using the doc viewer, there are a few bindings for navigating around.

Key Command Description
C-j forward-button Follow a forward button
C-k backward-button Follow a backward button
<backspace> graphql-doc-go-back Go back to a previous page
mouse-1 - Follow the next label under point
RET - Follow the next label under point

Configuration

Most of the "magic" in the module relies on a properly configured .graphqlconfig file, so follow the examples linked to create an appropriate setup.

LSP configuration is handled through GraphQL Config to handle custom directives/documents/validation etc.

These files will also be useful to other editors, so it would be worth checking them into version control.

Frequently asked questions

This module has no FAQs yet. Ask one?

TODO Appendix

󱌣 This module has no appendix yet. Write one?