Graphql-playground: Auto complete like graphiql

Created on 16 May 2018  Â·  19Comments  Â·  Source: graphql/graphql-playground

This issue pertains to the following package(s):

  • [ ] GraphQL Playground - Electron App
  • [x] GraphQL Playground HTML
  • [ ] GraphQL Playground
  • [ ] GraphQL Playground Express Middleware
  • [ ] GraphQL Playground Hapi Middleware
  • [ ] GraphQL Playground Koa Middleware
  • [ ] GraphQL Playground Lambda Middleware

What OS and OS version are you experiencing the issue(s) on?

Kubuntu 16.04

What version of graphql-playground(-electron/-middleware) are you experiencing the issue(s) on?

How do we see the version? Its the latest bundled in Prisma as of 15 May 2018

Its not a bug, only a suggestion:

You MUST have the feature of graphiql:

  • CTRL+ENTER in front of { users | } auto-completes with ALL fields of a User (ie it becomes { users {id, name, dob, ...} })
  • CTRL+ENTER in front of { users { | } } auto-completes with required or ID fields of a User (ie it becomes { users { id } })

Life is so much better with these :-)

rf0-needs-spec

Most helpful comment

Here is my vision:

insert-fields

All 19 comments

@anodynos I am only able to do the second feature in my graphiql/ where it gives me an ID field, when I type in {users} and hit ctrl+enter. Has this been implemented only recently in graphiql?

@capaj maybe, I can't remember where I found it, but it was very nifty indeed to have all the fields there, deleting the ones you don't want!

@anodynos that would be my preferred way of writing GQL queries

Any progress on that?

This feature is very helpful. Any progress so far?

It would also be great to has a button in the right "Docs" panel to generate and insert the query/mutation/subscription for the specific type with all its fields by one click.

FYI, Altair has a button to add queries and fragments from documentation. You can easily add a query (or fragment) you see in the documentation into the editor without having to manually type every field within the query: https://github.com/imolorhe/altair#add-queries-and-fragments-from-documentation.

Here is my vision:

insert-fields

+500

On Sun, Feb 17, 2019, 15:46 Alexey Rodionov <[email protected] wrote:

Here is my vision:

[image: insert-fields]
https://user-images.githubusercontent.com/7892779/52914630-e0aa6200-32db-11e9-819b-9f687d9a05cd.png

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/prisma/graphql-playground/issues/683#issuecomment-464465807,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AE64MOzR0ol06E8HmJ33qg_pzU07FdIwks5vOWs9gaJpZM4UAdjy
.

Small fix: this should work from the first level of nesting.

As for the recursive insert of fields, this is not a trivial task, because of avoiding of infinite recursion (cycles in the graph).

prefinal

Small fixes:

  • It would be great to display the description of current field at the bottom instead of the type (see #971).
  • In fact, the "Insert required fields" feature works 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.

Here's my vision:

autocomplete

  • 1 on this. Would really look forward to something like this

For all who are interested in this feature, it's implemented in Altair GraphQL IDE. :wink:

For all who are interested in this feature, it's implemented in Altair GraphQL IDE.

Works great, thanks!

Any progress on this ? <3

Newbie here, trying all clients and can only see autocomplete field names not values. Think autocomplete configuration should be revisited to include more options for newbies (like me):

  1. autocomplete.braces (complex types always need braces right?)
  2. autocomplete.default.values (also inserts a default "", number or anything else)
  3. autocomplete.mandatory.fields (if there are a ton of fields, it takes a long time)
  4. autocomplete.mutation.constructor.arguments (complex types in mutation arguments never show any additional auto completion) https://medium.com/atheros/json-as-an-argument-for-graphql-mutations-and-queries-3cd06d252a04 is an example with complex input type and there is no additional help after typing mutation input.

Or, is there something like this today in any other client?

Woah, so many options ;), decided to use the apollo express server with its graphiql client for now :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iagobruno picture iagobruno  Â·  16Comments

tpage99 picture tpage99  Â·  21Comments

heymartinadams picture heymartinadams  Â·  26Comments

michalkvasnicak picture michalkvasnicak  Â·  14Comments

lastmjs picture lastmjs  Â·  19Comments