-
Notifications
You must be signed in to change notification settings - Fork 95
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
[v2] Main issue for tracking progress on the v2 branch #164
Comments
…t spec, including SDL (#164) - Moved existing PSI code and IDE packages into a v1 sub package as v2 feature parity is established - Simplified graphql.config.json by removing the schema field now that the plugin discovers all schema definitions on its own - Removed v1 GraphQL parser and lexer that used the language service
…udio (#164) - Moved code that requires the JavaScript plugin into separate packages and graphql-javascript.xml
… plugin repo during alpha testing (#164)
- Removed references to JavaScript and TypeScript file types in JSGraphQLFindUsagesUtil.java which caused errors when running in Android Studio - Updated release info in plugin.xml to match alpha feature set
- Ignore errors from graphql-java KnownDirectives on type definitions as it only handles executable directive locations - Show directive completions based on declared directives and not only the schema which can be broken while typing
@koresar See my comments here for how to get this working: #145 (comment) |
Omg, this is incredible! Thank you for the amazing plugin. I love the new colours and features. So good! |
Hello @jimkyndemeyer I have a web app project. It uses a GraphQL endpoint (on my local machine). Previously, the plugin required the How would I setup a URI for my queries using the v2? |
@koresar I assume you want to introspect a GraphQL endpoint at a URL and print the schema as GraphQL SDL. The next alpha will support .graphqlconfig where you'll get a green arrow next to endpoint urls. Clicking the arrow executes an introspection query, and prints the result as GraphQL SDL to a file. Until then, you can use https://github.com/graphql-cli/graphql-cli |
@JCMais Have you defined any scopes in "Settings" > "Appearance & Behavior" > "Scopes"? The current alpha uses those to discover schema types. The upcoming alpha has a settings page where this is opt-in, along with support for .graphqlconfig files. |
@jimkyndemeyer it works, thank you! Also, I'm using |
@JCMais If you get completion the GraphQL parser has been injected, so you should see syntax highlighting. Please create a separate issue with a minimal repo project attached and I'll take a look. Include IDE version. |
- Introspection query execute line marker on url in .graphqlconfig - Print schema JSON as SDL line marker
Released https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/releases/tag/2.0.0-alpha-3 Note the upgrade notes if you're already using the alpha. |
Hey @jimkyndemeyer. Question. I am running separate projects: backend API, frontend SPA. Backend is on http://localhost:3000/graphql What should be the settings in SPA project to read the schema from backend introspection (just like it was in v1)? I cannot understand where to put my http://localhost:3000/graphql |
Endponts are configured using https://github.com/prismagraphql/graphql-config#specifying-endpoint-info Once you've added your schema path and endpoint url, you should get a green arrow in the editor gutter next to the endpoint url. Click the green arrow to run an introspection query that is saved to the file configured as the I'm planning on writing up docs for this as the new workflow is somewhat different from v1. |
@koresar The introspection feature was released yesterday in alpha-3. Can you check your plugin version and make sure it's updated. |
I did update today morning. 👍 Found the solution though. Here is the only way I could made it work: {
"schemaPath": "schema.graphql",
"extensions": {
"endpoints": {
"dev": {
"url": "http://localhost:3000/graphql"
}
}
}
} Thanks again! Marvellous plugin :) Btw. Found a bug.
|
…arker for string-only endpoint (#164)
I've got this error on my relay modern queries I'm using graphql-config to handle multiple graphql projects and schemas: {
"projects": {
"web": {
"schemaPath": "./entria/web/data/schema.graphql",
"includes": ["./entria/web/data/*.graphql"],
"extensions": {
"endpoints": {
"dev": {
"url": "http://localhost:5001/graphql"
}
}
}
},
"app": {
"schemaPath": "./entria/app/data/schema.graphql",
"includes": ["./entria/app/data/*.graphql"],
"extensions": {
"endpoints": {
"dev": {
"url": "http://localhost:5001/graphql"
}
}
}
},
} it does not recognize relay modern directives as well @connection and so on |
How does one install this version? I only see v1.7.3 available through Webstorm's plugin installer. |
@flux627 See the releases for install steps: https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/releases/tag/2.0.0-beta-1 |
Thank you! |
Published beta-2:
A thank you to the JetBrains team who contributed multiple pull requests. |
@jimkyndemeyer Is this a bug?
|
It is a bug. I reported it earlier. Just found a way to reproduce.
Problem: The panel from the above screenshot is present. |
@koresar Thanks for responding. Anand |
@anarasimhan oops. Misread your issue. My issue it totally different. Apologies. |
@anarasimhan Not a bug. You can't execute the JS files directly against a GraphQL endpoint, but you can use the "Edit GraphQL fragment" intention to create a separate editor tab that allows you to do it: |
@jimkyndemeyer Thanks. Makes sense. There can be more than one query in the js file. |
…ding the configuration model (#164)
…d unnecessary changes to checked-in remote schemas (#164)
🎉🤖 🚀 ⚡️ 2.0.0 is now on master! Thank you all so much for helping with the release. The release has been pushed to the JetBrains repository and should be available within a few days. Until then you should get a "2.0.0-end-of-beta" via the custom alpha/beta repository. That release is effectively the 2.0.0 but with at notification to let you know when the official release has been approved by JetBrains. You should then remove the custom repository URL as instructed in the notification. Once again, thank you for all the feedback, the bug reports and the discussions. I hope 2.0 will help you stay productive as you work with GraphQL. Best regards, |
After updating I got syntax error in the code which used to highlight correctly. It's a valid GraphQL query. It shouldn't be red. When I hover mouse over the red text the tooltip says:
|
@koresar Please create a separate issue for this with steps to reproduce. I see that you're using an injection comment which could be the reason why the newly introduced index doesn't discover the fragments. Also add the reason why the |
Limitations in 1.x and proposed solutions for 2.x
Only a single schema per-project
.graphqlconfig
File #125, Apollo Link State queries not supported #129, Save Schema if pulled from URL #140, Add support for Framework-specific Schema directives, e.g. Prisma #144, Allow having multiple configs in a project (scope per subfolder) #145Node.js + JavaScript plugin dependency
Changes to spec, grammar, and language difficult to support in the plugin
Developer experience with 2.x
The biggest change with 2.x is making the GraphQL Schema Definition Language (often abbreviated SDL) a first-class citizen in the plugin and not just a read-only view of the schema.
SDL has become part of the spec in graphql/graphql-spec#90 and is already widely adopted by the community for schema authoring.
A widely used example is the Apollo project where the schema is expressed using SDL inside a gql tagged template literal (https://www.apollographql.com/docs/apollo-server/v2/essentials/server.html)
With this in mind, 2.x of the plugin will provide first-class tooling support for writing SDL, including:
Any changes to the SDL type definitions will be immediately reflected in the relevant GraphQL queries and other operations within the given scope. This removes the manual step of having to either trigger an introspection query, or update a single combined .graphql schema file as required in 1.x of the plugin.
Overall, developers should be able to much more productive writing schema using SDL.
Documentation (work in progress)
https://gist.github.com/jimkyndemeyer/1903b65ff892f0811e76f16d8b530848
The text was updated successfully, but these errors were encountered: