aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/graphql.lua
blob: 55b3445bbdbc4ceb040900f063e8c0f1b69201fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

local server_name = 'graphql'
local bin_name = 'graphql-lsp'

configs[server_name] = {
  default_config = {
    cmd = {bin_name, 'server', '-m', 'stream'},
    filetypes = {'graphql'},
    root_dir = util.root_pattern('.git', '.graphqlrc'),
  },

  docs = {
    description = [[
https://github.com/graphql/graphiql/tree/main/packages/graphql-language-service-cli

`graphql-lsp` can be installed via `npm`:

```sh
npm install -g graphql-language-service-cli
```
]],
    default_config = {
      root_dir = [[root_pattern('.git', '.graphqlrc')]],
    },
  },
}

-- vim:et ts=2 sw=2