Skip to content
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

Closed
OlegIlyenko opened this issue Jan 23, 2016 · 4 comments
Closed

Execute named operation under a cursor #81

OlegIlyenko opened this issue Jan 23, 2016 · 4 comments

Comments

@OlegIlyenko
Copy link
Contributor

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.

@leebyron
Copy link
Contributor

This is a great suggestion.

@KyleAMathews
Copy link

I've used Sense a lot as well and agree it works very well and would fit
easily into GraphiQL.
On Mon, Jan 25, 2016 at 4:17 PM Lee Byron [email protected] wrote:

This is a great suggestion.


Reply to this email directly or view it on GitHub
#81 (comment).

@asiandrummer
Copy link
Contributor

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 run button, but maybe there is a way to mitigate that.

We could also do the similar background-color change for each operation context to clarify UI a bit more.

@opatut
Copy link

opatut commented Feb 25, 2016

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.

leebyron added a commit that referenced this issue Mar 10, 2016
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.
leebyron added a commit that referenced this issue Mar 10, 2016
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants