graphql / vscode-graphql

MIGRATED: VSCode GraphQL extension (autocompletion, go-to definition, syntax highlighting)
https://marketplace.visualstudio.com/items?itemName=Prisma.vscode-graphql
MIT License
555 stars 71 forks source link

Cannot read property 'projectName' of undefined #107

Closed remy closed 4 years ago

remy commented 5 years ago

Actual Behavior

Hover + alt does nothing.

Error in GraphQL Language server:

[Error - 12:01:36] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot read property 'projectName' of undefined
  Code: -32603 

Expected Behavior

Peeks…?

Steps to Reproduce the Problem Or Description

Installed as per instructions. I have this config:

{
  "schemaPath": "src/schema/*.graphql",
  "includes": ["database/*.graphql"],
  "extensions": {
    "endpoints": {
      "dev": "http://localhost:4000"
    }
  }
}

These are my schemas:

database/enums.graphql
database/types.graphql
src/generated/prisma/prisma.graphql
src/schema/directives.graphql
src/schema/enums.graphql
src/schema/index.graphql
src/schema/inputs.graphql
src/schema/types.graphql

Note that './database/*` is the source that generates prisma.graphql.

In src/schema/index.graphql I also import schemas as per:

# import * from '../generated/prisma/prisma.graphql'
# import * from './inputs.graphql'
# import * from './directives.graphql'
# import * from './types.graphql'
# import * from './enums.graphql'

In addition, symbol lookup doesn't work (when I hit cmd+r) it's just empty.

Specifications

Logs Of TS Server || GraphQL Language Service

[Error - 12:01:36] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot read property 'projectName' of undefined
  Code: -32603 
Jayphen commented 4 years ago

@remy You've probably moved on by now, but I found the issue.

includes should be include (not plural).

That's it.

acao commented 4 years ago

Now in graphql-config@3, documents is what we use for this, though i think there is still legacy support for include. please see the graphql-config docs or readme for updated graphql-config@3 config examples or other issues with this!