graphql / graphiql

GraphiQL & the GraphQL LSP Reference Ecosystem for building browser & IDE tools.
MIT License
16.06k stars 1.72k forks source link

Feature: Option to show observable results in a log #436

Open stubailo opened 7 years ago

stubailo commented 7 years ago

GraphiQL supports both promise and observable fetchers, which let us really easily add support for GraphQL subscriptions. However, this approach just shows the most recent subscription result.

If there was an option somewhere to show a log of all observable results instead of just the most recent one, that would be super useful! I'm not sure if it should be:

  1. The default (given subscriptions might be more common than live queries)
  2. A UI option that appears if your fetcher returns an observable
  3. A prop passed to the component

Or something else.

wincent commented 7 years ago

Sounds useful.

Exposing this in the UI is hard because it relies on making, gulp, design decisions. I do have some notions for what this could look like, but I am not a designer.

asiandrummer commented 7 years ago

@AGS- worked on getting the history pane, but it doesn't save the results yet. Maybe we should?

stubailo commented 7 years ago

I think to start with, adding a prop to configure this would be sufficient.

acao commented 2 years ago

I don't think graphiql is useful for subscriptions without this feature even - for example, this bug:

652

this remains an often requested feature now that we have documented support for observables and (async iterables as well - multipart IncrementalDelivery, etc). The IncrementalDelivery appends/sets results for @stream or @defer like it's supposed to, and subscriptions should do something like this ticket describes, and be able to be executed alongside a mutation if possible (this is a common workflow when testing graphql subscriptions!).