Autocomplete and syntax highlighting in embedded queries very slow
See original GitHub issueVersion and Environment Details
Operation system: macOS 10.15.4
IDE name and version: PhpStorm 2020.1 Build #PS-201.6668.153, built on April 13, 2020
Plugin version: 2.4.0
Schema stats: 472 types, 20 interfaces, 82 inputs, 30 enums, 13 unions, 1 scalars, 5 directives
Expected Behaviour
The syntax highlight should be instant and the other two mentioned functions also shouldn’t take longer than a second ideally.
Actual Behaviour
We found that in queries which are embedded in our javascript files the syntax highlighting takes 5sor more seconds to show up. Opening our schema.graphql
directly does not show the same behaviour there.
The Navigation on query fields (Cmd+Click on mac) sometimes takes several seconds till PHPStorm jumps to the schema.
The autocomplete popup when typing a new field in a query or pressing Ctrl+Space to open the autocomplete takes also several seconds.
Sometimes syntax highlighting never kicks in, but the navigation still works.
We have a rather large (I think) schema, so that might be too much to handle?
Steps to Reproduce / Link to Repo with Reproduction and Instructions
I cannot share our schema but I’m happy to provide profiling snapshots if you tell me how to create them.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:9
Top GitHub Comments
I am using hasura and easily reached
751 types, 1048 inputs, 150 enums, 21 scalars
That makes using this plugin pretty much unusable. I tried the suggested fixes, but doesn’t seem to work.
GraphiQL within hasura doesn’t have that issue
Hi Daniel.
I did a lot of work to make the plugin usable with the GitHub schema which is also quite large (326 types). I just tested with a gql tagged query and while it’s not instant, completion and highlighting is still usable: http://g.recordit.co/ziz64sLenY.gif
Given that the plugin looks for gql in all javascript and typescript file types, you could see a performance gain by limiting which of these files are part of your schema. You can use the
includes
glob in your.graphqlconfig
file to manage this. See https://jimkyndemeyer.github.io/js-graphql-intellij-plugin/docs/developer-guide#project-structure-and-schema-discoveryLet me know what you find.
Best regards, Jim.