January 2019
Intermediate to advanced
460 pages
10h 33m
English
As mentioned previously, this is the easiest method to update your user interface. The only step is to set an array of queries to be refetched. The Mutation component should look as follows:
<Mutation refetchQueries={[{query: GET_POSTS}]}
Each object that you enter in the refetchQueries array needs a query property. Each component relying on one of those requests is rerendered when the response for its associated query arrives. It also includes components that are not inside of the Feed class. All components using the post's GET_POSTS query are rerendered.
You can also provide more fields to each query, such as variables to send parameters with the re-fetch request. Submitting the form resends the query, and you can see ...
Read now
Unlock full access