question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Language features not working with multi projects

See original GitHub issue

Actual Behavior

Will only correctly validate first project

Expected Behavior

Validation should work for all projects

Steps to Reproduce the Problem Or Description

.graphqlrc.yml

projects:
  A:
    schema: ./src/schemas/A.json
    documents: ./src/graphql/A/**/*.gql
  B:
    schema: ./src/schemas/B.json
    documents: ./src/graphql/B/**/*.gql

Specifications

  • GraphQL for VSCode Extension Version: 0.3.1
  • VSCode Version: 1.48.2
  • OS Name: macOS
  • OS Version: 10.15.6

Logs Of TS Server || GraphQL Language Service

Log shows it always validate file with project A

8/28/2020, 11:33:41 AM [4] (pid: 49707) graphql-language-service-usage-logs: {"type":"usage","messageType":"initialize"}

undefined
[Error - 11:33:51 AM] Request textDocument/documentSymbol failed.
  Message: Request textDocument/documentSymbol failed with message: A cached document cannot be found.
  Code: -32603 
8/28/2020, 11:33:51 AM [4] (pid: 49707) graphql-language-service-usage-logs: {"type":"usage","messageType":"textDocument/didOpen","projectName":"A","fileName":"file:///.../A/query.gql"}

undefined
8/28/2020, 11:33:57 AM [4] (pid: 49707) graphql-language-service-usage-logs: {"type":"usage","messageType":"textDocument/didClose","projectName":"A","fileName":"file:///.../A/query.gql"}

undefined
[Error - 11:33:58 AM] Request textDocument/documentSymbol failed.
  Message: Request textDocument/documentSymbol failed with message: A cached document cannot be found.
  Code: -32603 
8/28/2020, 11:33:58 AM [4] (pid: 49707) graphql-language-service-usage-logs: {"type":"usage","messageType":"textDocument/didOpen","projectName":"A","fileName":"file:///.../B/query.gql"}

undefined
8/28/2020, 11:37:17 AM [4] (pid: 49707) graphql-language-service-usage-logs: {"type":"usage","messageType":"textDocument/didClose","projectName":"A","fileName":"file:///.../B/query.gql"}

undefined

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
Risbotcommented, Nov 6, 2020

here is my config file .graphqlrc.yml content:

projects:
  project1:
    schema: ./packages/project1/graphql-api/schema.graphql
    documents: ./packages/project1/gqls/*.ts
  project2:
    schema: ./packages/project2/graphql/schema.gql
    documents: ./packages/project2/**/*.graphql
    exclude: ./packages/project2/**/*.test.(tsx|ts)

project1 is work correctly but project2 ignoring itself configuration. When I change positions of projects, project2 start working like project1 before, and project1 have same issue like project2 before

3reactions
maslianokcommented, Aug 29, 2020

I’m experiencing the same problem.

.graphqlrc.json

{
  "projects": {
    "github": {
      "schema": "src/generated/github-schema.graphql",
      "documents": ["src/**/*.github.gql"]
    },
    "hasura": {
      "schema": "src/generated/hasura-schema.graphql",
      "documents": ["src/**/*.hasura.gql"]
    }
  }
}

in my case, both queries get validated using the first schema

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using multiple languages in one project - Stack Overflow
I have worked on many projects that contain a fairly diverse mix of languages. Unless it's a .NET project, you usually use these...
Read more >
go.uselanguageserver does not work on multi-project ... - GitHub
I am running VSCode 1.33.0 and am using vscode-go 0.9.3-beta.7. A workaround is to open a workspace in the Go subdirectory of your...
Read more >
Tutorial: Quick Project with Multi-Language Features
Tutorial: Quick Project with Multi-Language Features ; Click on the Language Selection and select Spanish from the drop down list. ; Next, make...
Read more >
Language Support in Visual Studio Code
Hundreds of programming languages supported · Language specific documentation · Language features in VS Code · Changing the language for the selected file....
Read more >
On multi-language software development, cross-language ...
Such links may present problems to developers. First, they are usually not part of any of the languages themselves but rather stand outside, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found