aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/graphql/init.lua
blob: 279b6e258c2d14db7b132623e85aacc0f9bae99d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
local util = require("lspconfig.util")

local server = require("nvim-lsp-installer.server")
local path = require("nvim-lsp-installer.path")
local npm = require("nvim-lsp-installer.installers.npm")

local root_dir = server.get_server_root_path("graphql")

return server.Server:new {
    name = "graphql",
    root_dir = root_dir,
    install_cmd = npm.packages { "graphql-language-service-cli@latest",  "graphql" },
    default_options = {
        cmd = { path.concat { root_dir, "node_modules", ".bin", "graphql-lsp" }, "server", "-m", "stream" },
        filetypes = { "typescriptreact", "javascriptreact", "graphql" },
        root_dir = util.root_pattern(".git", ".graphqlrc"),
    },
}