Closed numfin closed 6 months ago
This unfortunately isn't an issue we can accept as such and fix, because it's not fixable from our end.
I'd appreciate someone reaching out to the IntelliJ/Webstorm team about this, but the crucial thing here is that for the TS LSP plugin to work:
Otherwise only type inference is going to work, provided a typings file has been generated. We're planning to supplement this functionality with a CLI as well: #76
@kitten should we close this issue since cli is developed in #76 ? Or keep it to know progress of jetbrains integration?
probably someone with webstorm will come here so here is workaround for you:
npx gql.tada@canary generate
- will generate graphql-env.d.ts for you
I got it working with Webstorm yesterday. Did you enable the project TS env in the settings?
@krokhale is that anything we can document or add a sample configuration file for (like we have for VSCode)
@JoviDeCroock Nothing major to document, but essentially similar to vscode, one needs to switch the typescript from the bundled version to the one in:
~/code/node_modules/typescript
The option can be found in:
Settings -> Language & Frameworks -> Typescript
Make sure the Typescript language service is turned on.
@krokhale If we do decide to document some of this this might be quite major if Webstorm doesn't prompt you to do this — or at least, we do seem to be getting questions about it rather often
@kitten Well yeah, unfortunately it does not work out of the box in Webstorm and probably not the ideal experience compared to how it works in vscode. Generating a graphql-env.d.ts
does work though. fwiw, I am using Next 14.1. Another thing to note is that I have the official GraphQL plugin by Webstorm enabled. Probably worth reaching out and opening a ticket with the Jetbrains guys.
Hi everyone, the graphql-env.d.ts does get generated in webstorm. but code completion does not work. Even when you enable the graphql plugin. I've opened a ticket yesterday: https://youtrack.jetbrains.com/issue/WEB-65740#focus=Comments-27-9296748.0-0
Btw. it does work with the graphql plugin, if you have a local graph.schema file (Like in the pokemon example), the graphql plugin automatically used that file. It does not work with a remote schema file however.
@Jonne that could be an error surfaced in your tsserver
logs though 😅 we do support it so you might wanna check whether an error is surfaced.
@JoviDeCroock As far as I can judge, I don't see any errors in the tsserver logs. I can send them to you if you would like to have a look?
Closing due to inactivity.
It's very unclear to me whether TypeScript plugins are now working properly in Jetbrains' IDEs or Codestorm/Webstorm, or whether there's an active workaround to enable them properly (similar to how VSCode requires an additional step)
If someone knows the answer to this, please let me know.
If someone reads this and this still doesn't work, the CLI should always be the best fallback for situations where your editor/IDE isn't set up to run a TypeScript language server including TS plugin support. https://gql-tada.0no.co/reference/gql-tada-cli
experiencing this too
vscode:
webstorm:
The introspection files are generated fine, but official Jetbrains graphql plugin fails to autocomplete
official Jetbrains graphql plugin
I mean, just putting this out there, that has nothing to do with gql.tada
and afaik Jetbrains' IDEs still don't support TypeScript plugins fully and properly
official Jetbrains graphql plugin
I mean, just putting this out there, that has nothing to do with
gql.tada
and afaik Jetbrains' IDEs still don't support TypeScript plugins fully and properly
Yes, sorry, not trying to reopen this issue, just confirming that it's not an isolated case, and vscode experience here is indeed superior to jetbrains. Probably need to poke Jetbrain devs about this on the issue that @Jonne created above
the query return types are working correctly, and if I manually add wrong query then webstorm would tell me that it's incorrect, just the autocomplete doesn't work, as if graphql plugin can't detect this as graphql query unless I name the file with .graphql extension (for non gql.tada use case), then autocomplete works fine. So ts plugin/server works fine as far as I can see
Yep, sorry, I didn't actually get around to posting in the Jetbrains thread — I also think they might have multiple issues regarding this that match 🤔
My main fear though is that if we don't intervene, there'll be conflicts with their own GraphQL plugin. That said, we do have a special graphql.config
warning in doctor already, so we might be able to add another Jetbrains warning in our gql.tada doctor
command once the dust settles.
The main things to check btw are:
@_unmask
is added an "Unknown directive" error does not appear (if it does, it's from another plugin)If all those are working, then an editor is compatible and set up correctly to use the TypeScript plugin.
Describe the bug
It would be nice to be able to generate typings in cli https://www.reddit.com/r/graphql/comments/19921i6/gqltada_a_graphql_parser_written_in_typescript/
Reproduction
No response
gql.tada version
v1.2.1
Validations