kumarharsh / graphql-for-vscode

GraphQL syntax highlighting, linting, auto-complete, and more!
https://marketplace.visualstudio.com/items?itemName=kumar-harsh.graphql-for-vscode
MIT License
283 stars 45 forks source link

not working when used with golang-graphql #127

Open akashbdj opened 5 years ago

akashbdj commented 5 years ago

Hi,

I'm trying to use this extension in golang-graphql project. It doesn't work as expected. Also, I'm seeing this issue on vscode output tab:

Screen Shot 2019-03-11 at 7 18 43 PM

What's working: Syntax Highlighting What's not working: Go to definition, linting, etc.

Since this is a golang project, I don't have package.json. So I installed @playlyfe/gql as a global package and then pointed to it. "graphqlForVSCode.nodePath": "/usr/local/lib/node_modules"

Here's what the .gqlconfig looks like:

{
  schema: {
    files: "./**/*.gql"
  }
}

What should I do to make it work?

Thanks for your time, Akash

kumarharsh commented 5 years ago

Can you post a link to the golang-graphql project? I'll have a look

akashbdj commented 5 years ago

Hi @kumarharsh,

Thanks for quick response. I can't share the project; it's an internal tool. Here's what we are using: https://github.com/graph-gophers/graphql-go

Project structure looks like:

cmd/
    main.go
resolvers/
    x.go
    y.go
schema/
    query.gql
    mutation.gql
    types/
        a.gql
        b.gql
.gqlconfig

What's surprising here is: extension worked for a minute. I was able to click on types and it took me to the definition. I was also able to see the linting errors. But it stopped working; i didn't change anything.

Let me know if you need any other information. Thanks!

kumarharsh commented 5 years ago

@akashbdj I suspect it's something to do with watchman - try shutting down the watchman server and then open vscode again - do watchman shutdown-server, and then just reload your vscode window via Reload Window which will cause the plugin to get reinitialized and kick-start watchman automatically.

akashbdj commented 5 years ago

I already tried it after looking at other issues. I also tried updating watchman, it doesn't work in either case.

This is the message i'm seeing in vscode output console:

[Info  - 4:35:13 PM] NODE_PATH value is: /usr/local/lib/node_modules
[Info  - 4:35:14 PM] Module '@playlyfe/gql' loaded from: /usr/local/lib/node_modules/@playlyfe/gql/lib/index.js

Also, it's red indicating some sort of an error.

Screen Shot 2019-03-12 at 4 36 45 PM