We're developing our complete first app with Apollo and we are having an issue when using it with react-router.
We are using the new component and the problem is when we change the route of the app it uses the data originally was fetched (even if the data changed on the server):
import React from 'react';
import { Query } from 'react-apollo';
import { GET_FAVORITE_JOBS } from './graphql';
import FavoriteJobList from './stateless';
export default () => (
<div>
<Query query={GET_FAVORITE_JOBS}>
{({ loading, error, data }) => (
<FavoriteJobList loading={loading} error={error} data={data} />
)}
</Query>
</div>
);
I've seen this: https://www.apollographql.com/docs/react/essentials/queries.html#refetching
Do we have to use refetch on componentDidMount?
thanks!