Ctrl-Enter executes entire file, not just the single query
See original GitHub issueDescribe the bug Often I have multiple queries or mutations within a single graphql file for testing purposes or as examples of how to use a particular operation.
In previous versions of the GraphQL plugin, if I had multiple queries or mutations in a graphql file, pressing Ctrl-Enter would execute only the query or mutation under the cursor, similar to the way SQL queries are executed in the database console. However, now when I hit the same keyboard combination, the plugin is attempting to send the entire file/buffer.
To Reproduce Assume a graphql file that looks something like this:
query someQuery {
doSomeQuery {
id name created
}
}
query anotherQuery {
anotherQuery {
id title
}
}
- Place the cursor somewhere within the bounds of
someQuery
- Press
Control-Enter
- The following response is provided:
{
"errors": [
{
"message": "Must provide operation name if query contains multiple operations.",
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
}
}
]
}
Expected behavior
I would expect only the single query (someQuery
) to be sent to the graph server and executed.
Version and Environment Details Operation system: MacOS 10.14.6 IDE name and version: IntelliJ IDEA 2020.2.3 (Ultimate Edition) Build #IU-202.7660.26, built on October 6, 2020 Runtime version: 11.0.8+10-b944.34 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 10.14.6 GC: ParNew, ConcurrentMarkSweep Memory: 1979M Cores: 16 Non-Bundled Plugins: com.github.novotnyr.jwt-intellij-plugin, com.jetbrains.plugins.ini4idea, org.intellij.plugins.hcl, com.intellij.react.css.modules, org.jetbrains.kotlin, com.intellij.lang.jsgraphql, com.jetbrains.php, com.vexus2.cakestorm, Pythonid, ru.meanmail.plugin.requirements, org.jetbrains.plugins.go Plugin version: 2.7.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:5
Top GitHub Comments
Fixed, will release it approximately during this week.
Doesn’t work on new version of Idea. When I want to send one of the operation, I put a caret on that operation, but the whole file is sent.
Expected behavior Placing caret inside an operation and pressing Ctrl+Enter should send only this operation
PS: I confirm that if you select the required operation, only that operation is sent. But this is very inconvenient.
Version and Environment Details Operation system: mac OS BigSur 11.2 (20D64) IDE name and version: IntelliJ IDEA 2020.3.2 (Ultimate Edition) Build #IU-203.7148.57 Plugin version: 2.7.1