graphql-for-vscode icon indicating copy to clipboard operation
graphql-for-vscode copied to clipboard

not working when used with golang-graphql

Open akashbdj opened this issue 5 years ago • 4 comments

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

akashbdj avatar Mar 11 '19 13:03 akashbdj

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

kumarharsh avatar Mar 11 '19 14:03 kumarharsh

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!

akashbdj avatar Mar 11 '19 14:03 akashbdj

@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.

kumarharsh avatar Mar 12 '19 10:03 kumarharsh

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

akashbdj avatar Mar 12 '19 11:03 akashbdj