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

[Ctrl+Shift+Enter] to autofill all fields at cursor #605

Closed
aoudiamoncef opened this issue Mar 3, 2019 · 13 comments
Closed

[Ctrl+Shift+Enter] to autofill all fields at cursor #605

aoudiamoncef opened this issue Mar 3, 2019 · 13 comments

Comments

@aoudiamoncef
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
GraphiQL feature implementation

Additional context
Already, issue is opened on GraphQL Playground

@welcome
Copy link

welcome bot commented Mar 3, 2019

👋🏾Thanks for opening your first issue here! Be sure to follow the issue template! ✌🏾

@imolorhe
Copy link
Collaborator

imolorhe commented Mar 3, 2019

@Sparow199 What exactly is the feature request? Altair already has autocompletion.

@aoudiamoncef
Copy link
Author

aoudiamoncef commented Mar 4, 2019

@imolorhe , when i have:
{ user |<-(current cursor position) } -> CTRL + ENTER will add all availlable fileds in user type. It's faster than add queries and types from documentation tab, i think that it's more intuitif when you have occasionally users in your APIs.
Thanks !

@imolorhe imolorhe changed the title Add fileds auto completion in query editor [Ctrl+Shift+Enter] to autofill all fields at cursor Mar 6, 2019
@vecernik
Copy link

+1

@guptaavi
Copy link

@imolorhe I see this issue is closed but I can't seem to make it work in version 2.1.4 of the Chrome extension. In which app version will this feature be available? Thanks!

@aoudiamoncef
Copy link
Author

aoudiamoncef commented Mar 24, 2019 via email

@imolorhe
Copy link
Collaborator

It should be available. You need to set the cursor over the parent field and press Ctrl+Shift+Enter for it to work. That's how it works for now.

@imolorhe
Copy link
Collaborator

I'll add a gif showing how it works here later.

@imolorhe
Copy link
Collaborator

2019-03-24 10 26 33 PM

There's a little bug caused by the code for this running outside the angular zone, which I missed (it only shows in production). I would fix that in the next version, but the bug doesn't prevent it from working. You just have to perform another event (like move the mouse, or press an arrow key, etc).

@guptaavi
Copy link

@imolorhe Thank you! It does work if I perform another event (arrow key) after pressing Ctrl + Shift + Enter. This is a real time-saver! Is it by any chance possible to "recursively" expand fields in all nested types? I understand this could cause problems with cyclic dependencies but maybe this can be limited with a max depth of recursion? Thank you for this great product! Love it!

@imolorhe
Copy link
Collaborator

@guptaavi That is a next step in the iteration. One of the concerns I have now has to do with what shortcut to use for that. Ideally you would want to have both, considering you wouldn't always want to recursively fill all fields. As for the depth level, it would use the same addQueryDepthLimit used for the ADD QUERY functionality today.

@FluorescentHallucinogen
Copy link
Contributor

@imolorhe

I'll add a gif showing how it works here later.

IMO, the current behavior is very unintuitive and has low feature discoverability. The situation is similar to GraphiQL. Do you know that GraphiQL has the autocomplete feature for years? How users learn about the Ctrl+Shift+Enter hotkey?

I've collected my ideas for improving the UX and feature discoverability in #690.

@guptaavi

Is it by any chance possible to "recursively" expand fields in all nested types? I understand this could cause problems with cyclic dependencies but maybe this can be limited with a max depth of recursion?

It would be nice to split up the feature to two: "Insert required fields" and "Insert all fields". The "Insert required fields" adds only the minimum possible set of fields, so that the query would be valid. In this case, in fact, the "Insert required fields" feature should work recursively anyway: if a certain type has required fields, which are related types that also have required fields, then it will be necessary to add them all recursively.

@imolorhe
Copy link
Collaborator

@FluorescentHallucinogen I didn't know the autocomplete feature was in GraphiQL already! 😮Nice find.

I agree that there's a lot that can be done to improve the UX for a lot of the features currently available on Altair. At the moment I've updated the docs to try to include even more information about what can be done in Altair and also started including the keyboard shortcuts in the settings dialog, but this isn't the same as having an intuitive interface on its own.

I wouldn't mind having a UX review of the app in general either 😉

As for @guptaavi's request, I think they are all 3 different functionalities (fill required fields, fill all fields, and fill all fields recursively). This means that the UX needs to be good enough to allow the users know about how to use each of those features. There's also the concern about the hotkeys that would trigger them (PS: Ctrl+Enter is already used for sending requests).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants