Skip to content

[graphql-vscode] Language server does not update schema cache if graphql-config.load.rootDir does not contain schema file #2767

@benatshippabo

Description

@benatshippabo

Description

Whenever graphql-config.load.rootDir does not contain the schema file, the language server does not pick up schema file changes.

Example setting:

{
  "graphql-config.load.rootDir": "configs"
}

Example fs:

.
├── .vscode
│  └── settings.json
├── configs
│  └── .graphqlrc.yml
├── README.md
├── schema.graphql
└── src
   ├── mutation.graphql
   └── query.graphql

Note

The above example is just to demonstrate the bug, realistically we have something such as:

.
├── frontend
│  ├── .graphqlrc.yml
│  └── operations
└── server
   ├── .graphqlrc.yml
   ├── operations
   ├── resolvers
   └── schema.graphql

And since we cannot have multiple projects until #2616 we take the loss and just let the extension language server parse operations in the frontend folder.

Reproduction

https://github.com/benatshippabo/graphql-vscode-bug

Suggestion

Haven't looked at the code yet, but maybe we can just put a watcher on the schema file.

cf: https://discord.com/channels/625400653321076807/863688262181453845/1020491480634249317

Metadata

Metadata

Assignees

No one assigned

    Labels

    lsp-servergraphql-language-service-server

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions