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

refetch is gone after remount? #142

Closed
pfulop opened this issue Aug 15, 2016 · 2 comments
Closed

refetch is gone after remount? #142

pfulop opened this issue Aug 15, 2016 · 2 comments
Assignees
Labels

Comments

@pfulop
Copy link

pfulop commented Aug 15, 2016

Hi,
I have noticed that after upgrade to new version with new api, I sometimes don't get refetch in props. By sometimes I mean when component is remounted (I go to other page and go back using react-router).

This is on first load
errors : null fetchMore : (vars) loading : true refetch : (vars) startPolling : (pollInterval) stopPolling : () variables : undefined __proto__ : Object

This is after remount:
errors : null getMyLastParticipations : Array[1] loading : false variables : undefined __proto__ : Object

I am not sure If I am just not getting some part of how the client works, but I would really need refetch to be available at all times. For example, if user logouts and then other user login, he will see old users data since the refetch didn't happen.

@jbaxleyiii
Copy link
Contributor

@pfulop thanks for the report! I'll take a look!

@jbaxleyiii
Copy link
Contributor

Yep this was a bug! refetch and fetchMore don't exist before the componentDidMount method is called since an observable query isn't setup yet. I've added a mocked way to call those which will run a normal query until they are replaced by the actual observer.

Thanks for reporting!

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

No branches or pull requests

3 participants