Closed kdong007 closed 4 years ago
@kdong007 does the file name match this list?
https://graphql-config.com/usage
the same list is in the readme.
it looks like you are referring to a graphqlrc.yml
file instead of .graphqlrc.yml
, but I can't tell because there is no graphql config file in the repo?
ah! i forgot to include the .
in the readme update.
readme is updated. let me know if it works when you name the config file as expected
@acao Thanks for your attention.
I have update the config but the plugin is still not working. No hover and No definition found for xxxx
, on both Windows and Mac
The config is checked into repo.
Here are some logs from "GraphQL Language Server"
2020-09-20, 8:39:21 a.m. [4] (pid: 2788) graphql-language-service-usage-logs: {"type":"usage","messageType":"initialize"}
undefined
2020-09-20, 8:39:21 a.m. [4] (pid: 2788) graphql-language-service-usage-logs: {"type":"usage","messageType":"textDocument/didOpen","projectName":"default","fileName":"file:///c%3A/Users/Mars/Desktop/projects/sample-graphql/src/schema.gql"}
undefined
2020-09-20, 8:40:26 a.m. [4] (pid: 2788) graphql-language-service-usage-logs: {"type":"usage","messageType":"textDocument/didOpen","projectName":"default","fileName":"file:///c%3A/Users/Mars/Desktop/projects/sample-graphql/src/server.ts"}
undefined
[Error - 8:40:26 a.m.] Request textDocument/documentSymbol failed.
Message: Request textDocument/documentSymbol failed with message: A cached document cannot be found.
Code: -32603
[Error - 8:40:26 a.m.] Request textDocument/documentSymbol failed.
Message: Request textDocument/documentSymbol failed with message: A cached document cannot be found.
Code: -32603
[Error - 8:40:26 a.m.] Request textDocument/documentSymbol failed.
Message: Request textDocument/documentSymbol failed with message: A cached document cannot be found.
Code: -32603
2020-09-20, 8:42:46 a.m. [4] (pid: 2788) graphql-language-service-usage-logs: {"type":"usage","messageType":"textDocument/didChange","projectName":"default","fileName":"file:///c%3A/Users/Mars/Desktop/projects/sample-graphql/src/schema.gql"}
undefined
2020-09-20, 8:42:47 a.m. [4] (pid: 2788) graphql-language-service-usage-logs: {"type":"usage","messageType":"textDocument/didChange","projectName":"default","fileName":"file:///c%3A/Users/Mars/Desktop/projects/sample-graphql/src/schema.gql"}
undefined
2020-09-20, 8:42:47 a.m. [4] (pid: 2788) graphql-language-service-usage-logs: {"type":"usage","messageType":"textDocument/didChange","projectName":"default","fileName":"file:///c%3A/Users/Mars/Desktop/projects/sample-graphql/src/schema.gql"}
undefined
2020-09-20, 8:42:48 a.m. [4] (pid: 2788) graphql-language-service-usage-logs: {"type":"usage","messageType":"textDocument/didChange","projectName":"default","fileName":"file:///c%3A/Users/Mars/Desktop/projects/sample-graphql/src/schema.gql"}
And here is on interesting log, only happened once on Windows, not Mac
(node:2788) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/c%3A/Users/Mars/Desktop/projects/sample-graphql/src/schema.gql'
at Object.openSync (fs.js:440:3)
at Object.func [as openSync] (electron/js2c/asar.js:140:31)
at Object.readFileSync (fs.js:342:35)
at Object.fs.readFileSync (electron/js2c/asar.js:542:40)
at c:\Users\Mars\.vscode\extensions\prisma.vscode-graphql-0.3.6\node_modules\graphql-language-service-server\dist\MessageProcessor.js:320:35
at Array.map (<anonymous>)
at MessageProcessor.handleWatchedFilesChangedNotification (c:\Users\Mars\.vscode\extensions\prisma.vscode-graphql-0.3.6\node_modules\graphql-language-service-server\dist\MessageProcessor.js:313:43)
at c:\Users\Mars\.vscode\extensions\prisma.vscode-graphql-0.3.6\node_modules\graphql-language-service-server\dist\startServer.js:164:122
at handleNotification (c:\Users\Mars\.vscode\extensions\prisma.vscode-graphql-0.3.6\node_modules\vscode-jsonrpc\lib\main.js:502:43)
at processMessageQueue (c:\Users\Mars\.vscode\extensions\prisma.vscode-graphql-0.3.6\node_modules\vscode-jsonrpc\lib\main.js:273:17)
(node:2788) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)
(node:2788) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
i re-created your case using graphqlrc.yml
, but found renaming the file to .graphqlrc.yml
fixed it and restored language features for me on linux. you'll have to re-start the extension.
this should improve error handling when config isn't present https://github.com/graphql/graphiql/pull/1667
see the readme for known issues regarding "cached document cannot be found"
Sorry I forgot to mention, I did use the file with dot .graphqlrc.yml
https://github.com/kdong007/sample-graphql/blob/master/.graphqlrc.yml
maybe its something related to global binary/package not installed on my side?
hmm, there aren't any binaries for you to install AFAIK, unless you're referring to nodejs?
your log output in macosx looks fine
well. of course I have node installed LOL. v12.18.0
Tried on Linux too. Not working.
Tried VSCdoe setting "vscode-graphql.useSchemaFileDefinition": true,
not working.
Here is the famous "not happening on my side" problem LOL
here it is with your repo!
i created an example.tsx file and it looks like completion and validation is working
you're correct that useSchemaFileDefinition
isn't working now, so I need to look into what's regressed
and I see now that the schema completion has regressed somehow? good catch!
oops. We were talking about two different things
You are talking about editor support in writing query. But I am talking about editor support in writing schema. like Hover/"Go to definition"/autocomplete
yeah, this was all working great before i introduced all the logic for generated schemas, so i'm sure its just a small bug. thank you!
outline support works fine, which means the definitions are being cached properly
@kdong007 found the regression! try renaming your schema to .graphql
for now. not sure how .gql
got removed from the allowed extensions array
Awesome! it's all working now.
awesome! just released support for .gql anyways! cheers!
Actual Behavior
No hover No auto suggestion
I added config file
graphqlrc.yml
using your sample config, restarted VSCode, but it doesn't work.Expected Behavior
Plugin work as stated
Steps to Reproduce the Problem Or Description
https://github.com/kdong007/sample-graphql
Specifications
Logs Of TS Server || GraphQL Language Service