graphql / graphiql

GraphiQL & the GraphQL LSP Reference Ecosystem for building browser & IDE tools.
MIT License
16.13k stars 1.73k forks source link

[lsp-server] 🐞 not working on neovim + coc #3649

Open yuriteixeira opened 4 months ago

yuriteixeira commented 4 months ago

Is there an existing issue for this?

Current Behavior

Auto-completion, "go to definition" and general LSP functionality expectations are not working.

Expected Behavior

The aforementioned expectations should work.

Steps To Reproduce

IMPORTANT: IntelliJ & https://github.com/neovim/nvim-lspconfig clients work as expected.

Environment

graphql-language-service-cli 3.4.1
├── graphql-language-service 5.2.1
└─┬ graphql-language-service-server 2.13.1
  └── graphql-language-service 5.2.1

Nvim

NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1716656478

Coc

commit 51692dc1d148f67f18573d1afeb4724dc5a06506 (HEAD -> release, origin/release)
Author: Heyward Fann <fannheyward@gmail.com>
Date:   Thu Jul 4 19:38:38 2024 +0800

Anything else?

No response

acao commented 4 months ago

@yuriteixeira what do you have in your graphql config file or package.json entry as per the readme?

yuriteixeira commented 4 months ago

@acao sure, here it is:

Filename: .graphqlrc.yaml

###############################################################################
# GraphQL configuration file
#
# Configure the graphQL tooling, like cli and generation of graphql typescript
# types and definitions.
#
# The 'codegen' extension manage the generation of typescript types for the
# backend graphQL API.
#
# The 'codegen' extension uses a set of plugins to generate the types:
# - typescript, convert the schema to typescript types
# - typescript-operations, convert the queries and fragments
# - near-operation-file-preset, generates the definitions next to the gql file
# - typed-document-node, create definitions for the queries with specific types
#
# More info:
# - https://graphql-cli.com/
# - https://graphql-config.com/
# - https://graphql-code-generator.com/
###############################################################################
schema: './src/libs/backend/schema.gql'
documents:
  - ./src/**/*.gql
extensions:
  codegen:
    generates:
      ./src/libs/backend/schema.gql.d.ts:
        config:
          enumsAsTypes: true
          skipTypename: true
        plugins:
          - add:
              content:
                - '/* *****************************************************************************'
                - ' * THIS FILE IS GENERATED - PLEASE DO NOT EDIT'
                - ' * '
                - ' * This file contains typescript definitions for the backend graphQL API'
                - ' *****************************************************************************/'
          - typescript
      ./src:
        preset: near-operation-file
        presetConfig:
          baseTypesPath: ./libs/backend/schema.gql.d.ts
          extension: .gql.d.ts
        config:
          documentVariableSuffix: ''
          namingConvention: 'keep'
          enumsAsTypes: true
          constEnums: true
          skipTypename: true
          exportFragmentSpreadSubTypes: true
        plugins:
          - add:
              content:
                - '/* *****************************************************************************'
                - ' * THIS FILE IS GENERATED - PLEASE DO NOT EDIT'
                - ' * '
                - ' * This file contains typescript definitions for the backend graphQL API'
                - ' *****************************************************************************/'
          - typescript-operations
          - typed-document-node