aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/graphql.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/lua/lspconfig/graphql.lua b/lua/lspconfig/graphql.lua
new file mode 100644
index 00000000..05fecf87
--- /dev/null
+++ b/lua/lspconfig/graphql.lua
@@ -0,0 +1,31 @@
+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 = {
+ package_json = 'https://raw.githubusercontent.com/graphql/graphiql/main/packages/graphql-language-service-cli/package.json',
+ 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