Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with Webstorm/Jetbrains #80

Closed
3 tasks done
numfin opened this issue Feb 26, 2024 · 12 comments
Closed
3 tasks done

Doesn't work with Webstorm/Jetbrains #80

numfin opened this issue Feb 26, 2024 · 12 comments
Labels
editor support ✍️ An issue related to a specific editor, extension, editor or IDE, external from gql.tada won't fix 🛑 This issue won't be fixed as part of the current roadmap

Comments

@numfin
Copy link

numfin commented Feb 26, 2024

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

  • I can confirm that this is a bug report, and not a feature request, RFC, question, or discussion, for which GitHub Discussions should be used
  • Read the docs.
  • Follow our Code of Conduct
@kitten
Copy link
Member

kitten commented Feb 26, 2024

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:

  • the IDE has to use the workspace's installation of TS
  • and;or load TS plugins as usual

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

@numfin
Copy link
Author

numfin commented Feb 26, 2024

@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

@krokhale
Copy link

I got it working with Webstorm yesterday. Did you enable the project TS env in the settings?

@JoviDeCroock
Copy link
Member

@krokhale is that anything we can document or add a sample configuration file for (like we have for VSCode)

@krokhale
Copy link

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

@kitten
Copy link
Member

kitten commented Feb 28, 2024

@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

@krokhale
Copy link

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

@Jonne
Copy link

Jonne commented Feb 28, 2024

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

@Jonne
Copy link

Jonne commented Feb 28, 2024

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.

@JoviDeCroock
Copy link
Member

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

@Jonne
Copy link

Jonne commented Feb 28, 2024

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

@kitten kitten added the won't fix 🛑 This issue won't be fixed as part of the current roadmap label Feb 29, 2024
@kitten
Copy link
Member

kitten commented Apr 23, 2024

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

@kitten kitten closed this as completed Apr 23, 2024
@kitten kitten added the editor support ✍️ An issue related to a specific editor, extension, editor or IDE, external from gql.tada label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor support ✍️ An issue related to a specific editor, extension, editor or IDE, external from gql.tada won't fix 🛑 This issue won't be fixed as part of the current roadmap
Projects
None yet
Development

No branches or pull requests

5 participants