From 064ec8bc38ec7e281fad2ee32b936583ed690f91 Mon Sep 17 00:00:00 2001 From: Chris Rawnsley Date: Mon, 20 Mar 2023 09:58:04 +0000 Subject: fix(graphql): fix crash on projects without graphql (#2517) The GraphQL language server needs a configuration file to initialise and the `graphql` package from NPM. Rooting on `.git` alone causes this server to repeatedly try opening and then close for each matching file type when it cannot find the config it is looking for. See: https://the-guild.dev/graphql/codegen/docs/getting-started/installation#global-installation --- lua/lspconfig/server_configurations/graphql.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lua') diff --git a/lua/lspconfig/server_configurations/graphql.lua b/lua/lspconfig/server_configurations/graphql.lua index 2d586c9e..ab5b2fda 100644 --- a/lua/lspconfig/server_configurations/graphql.lua +++ b/lua/lspconfig/server_configurations/graphql.lua @@ -11,7 +11,7 @@ return { default_config = { cmd = cmd, filetypes = { 'graphql', 'typescriptreact', 'javascriptreact' }, - root_dir = util.root_pattern('.git', '.graphqlrc*', '.graphql.config.*', 'graphql.config.*'), + root_dir = util.root_pattern('.graphqlrc*', '.graphql.config.*', 'graphql.config.*'), }, docs = { @@ -24,7 +24,7 @@ https://github.com/graphql/graphiql/tree/main/packages/graphql-language-service- npm install -g graphql-language-service-cli ``` -Note that you must also have [the graphql package](https://github.com/graphql/graphql-js) installed and create a [GraphQL config file](https://www.graphql-config.com/docs/user/user-introduction). +Note that you must also have [the graphql package](https://github.com/graphql/graphql-js) installed within your project and create a [GraphQL config file](https://the-guild.dev/graphql/config/docs). ]], default_config = { root_dir = [[util.root_pattern('.git', '.graphqlrc*', '.graphql.config.*', 'graphql.config.*')]], -- cgit v1.2.3-70-g09d2