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

Fix fallback of data attribute in query result #146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix fallback of data attribute in query result #146

wants to merge 1 commit into from

Conversation

sgoll
Copy link
Contributor

@sgoll sgoll commented Apr 29, 2019

Related to #127.

As described in https://www.apollographql.com/docs/react/essentials/queries#props, the data object is either the actual query result, or the empty object {} when the data is not (yet) available.

The type of QueryHookResult should match that.

As described in https://www.apollographql.com/docs/react/essentials/queries#props, the `data` object is either the actual query result, or the empty object `{}` when the data is not (yet) available.
@sgoll
Copy link
Contributor Author

sgoll commented Apr 29, 2019

Alright, it seems it's more complicated than this. I guess we'd need a type union to differentiate between loading and/or failed queries (that have data of {}) and completed queries (that have actual data).

And then there's partial queries also …

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

Successfully merging this pull request may close these issues.

1 participant