-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Execute named operation under a cursor #81
Comments
This is a great suggestion. |
I've used Sense a lot as well and agree it works very well and would fit
|
I love this idea! I'm leaning towards making existing shortcut and "run" button context sensitive - GraphQL operations could be huge and it might be difficult to position/find the separate We could also do the similar background-color change for each operation context to clarify UI a bit more. |
To reduce the magic, the UI could have one execute ("play" icon) button next to each query/mutation definition (e.g. in the gutter to the left), instead of the global button. The current query/mutation would be indicated by highlighting one of the buttons, the Shortcut would "press" that highlighted button. |
This enables GraphiQL to support multiple queries in the editor pane at the same time. When multiple queries exist, the run button becomes a drop-down menu showing the names of all queries available to run - forcing a selection. Cmd+Enter still runs a query, but it runs whatever the last query was unless the cursor is within the bounds of a query - then it runs that query. This implements #81 and #40.
This enables GraphiQL to support multiple queries in the editor pane at the same time. When multiple queries exist, the run button becomes a drop-down menu showing the names of all queries available to run - forcing a selection. Cmd+Enter still runs a query, but it runs whatever the last query was unless the cursor is within the bounds of a query - then it runs that query. This implements #81 and #40.
When I'm working with GraphiQL, more often than not, I have several queries in the editor pane. A typical use-case is to have a mutation and query around in order to make changes and see their effects on different queries.
At the moment I need to comment out all of the queries except one I would like to execute. It can become tiresome after some time. That's because I would like to suggest an alternative approach: an ability to execute query under the cursor. As far as i saw, this is pretty common feature available in similar applications. For instance, I use this feature a lot in elasticsearch sense (which is now part of marvel plugin) and find it pretty useful.
So the idea would be to either have a separate context sensitive shortcut/button or make existing shortcut and "run" button context sensitive. If an editor cursor is positioned somewhere inside of some named query, then in addition to a query, GraphiQL will also send the operation name to a server.
The text was updated successfully, but these errors were encountered: