aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/installers/graphql.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/nvim-lsp-installer/installers/graphql.lua')
-rw-r--r--lua/nvim-lsp-installer/installers/graphql.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/installers/graphql.lua b/lua/nvim-lsp-installer/installers/graphql.lua
new file mode 100644
index 00000000..b7d5968c
--- /dev/null
+++ b/lua/nvim-lsp-installer/installers/graphql.lua
@@ -0,0 +1,18 @@
+local util = require('lspconfig.util')
+
+local installer = require('nvim-lsp-installer.installer')
+local capabilities = require('nvim-lsp-installer.capabilities')
+
+local root_dir = installer.get_server_root_path('graphql')
+
+return installer.create_lsp_config_installer {
+ name = "graphql",
+ root_dir = root_dir,
+ install_cmd = [[npm install graphql-language-service-cli@latest graphql]],
+ default_options = {
+ cmd = { root_dir .. "/node_modules/.bin/graphql-lsp", "server", "-m", "stream" },
+ filetypes = { 'typescriptreact', 'javascriptreact', 'graphql' },
+ root_dir = util.root_pattern('.git', '.graphqlrc'),
+ capabilities = capabilities.create(),
+ },
+}