question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ctrl-Enter executes entire file, not just the single query

See original GitHub issue

Describe 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
  }
}
  1. Place the cursor somewhere within the bounds of someQuery
  2. Press Control-Enter
  3. 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:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:5

github_iconTop GitHub Comments

5reactions
vepanimascommented, Feb 10, 2021

Fixed, will release it approximately during this week.

1reaction
akahancommented, Feb 5, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I run just the statement my cursor is on in SQL Server ...
Use Ctrl + KU to select a line. Then use F5 to run it. Although it only works for single line selection, still...
Read more >
[BUG] Run MySQL Query executes entire *.sql file script ...
Hi, version 3.9.1 has been able to correctly identify the SQL of each statement, and bind the shortcut as ctrl+enter (run current or...
Read more >
SQL Server Management Studio keyboard shortcuts
Display the New File dialog box to create a file, CTRL+N ... Run the selected portion of the query editor or the entire...
Read more >
CTRL+ENTER not working as it should - Toad for Oracle
So I just went into the options and assigned the Execute Statement to CTRL+ENTER, but it keeps executing my SQLs as Snippet, that...
Read more >
SQL Developer CLT + ENTER shortcut executes all the ...
When I highlight the SQL statement and run it with CLTL+ENTER shortcut it runs fine and executes only that query.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found