nvim/lua/user/lsp_servers/graphql.lua
Prabhat Maurya 5793c3da7f update
2026-01-29 19:59:22 +05:30

21 lines
617 B
Lua

-- 1. Configuration
vim.lsp.config('graphql', {
cmd = { "graphql-lsp", "server", "-m", "stream" },
filetypes = { "graphql", "gql", "javascript", "typescript", "typescriptreact", "javascriptreact" },
-- This ensures GraphQL only starts if it finds a config file
root_markers = {
".graphqlrc",
".graphqlrc.json",
".graphqlrc.yaml",
".graphqlrc.yml",
"graphql.config.json",
"graphql.config.yaml",
"graphql.config.yml"
},
capabilities = require("cmp_nvim_lsp").default_capabilities(),
})
-- 2. Enable the server
vim.lsp.enable('graphql')