Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Automatically handle loading and failure renders #268

Closed
sedubois opened this issue Oct 12, 2016 · 6 comments
Closed

Automatically handle loading and failure renders #268

sedubois opened this issue Oct 12, 2016 · 6 comments

Comments

@sedubois
Copy link

sedubois commented Oct 12, 2016

Hi and apologies again if this is documented somewhere, couldn't track it down. If possible, documentation would be needed.

It seems Apollo requires to manually handle cases when data is not yet available in a view, or when a failure occurs, leading to more boilerplate/bloat code.

Like in Relay, it should be possible for the developer to just "forget" about loading and failure cases and trust that a view is rendered only when data is available. (Of course, with the option of being able to configure custom failure and error rendering.)

@seeden
Copy link

seeden commented Oct 12, 2016

You can simply create component/decorator with this functionality based on loading property

@sedubois
Copy link
Author

sedubois commented Oct 12, 2016

@seeden thanks, but that's something to add on every component? What I mean is that specific handling loading/error cases should be something opt-in. In general shouldn't need to think about that for each and every component, IMHO things should "just work" like in Relay.

@seeden
Copy link

seeden commented Oct 12, 2016

@sedubois what if you don't want to use it because you want to show something else?

@sedubois
Copy link
Author

@seeden Relay allows to configure the renders, if the default behaviour isn't appropriate for your case (see doc).

@seeden
Copy link

seeden commented Oct 12, 2016

@sedubois you need to use graphql that means you can use your own instead of graphql which will use graphql inside your own component. But I agree it will be nice to have it in the graphql too

@jbaxleyiii
Copy link
Contributor

closing in favor of #272

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

No branches or pull requests

3 participants