In order to display data we first need to fetch it. The Query component allows us to describe which data we are interested and automatically handle the fetching of our data. Once we received the data we can render it using React. Since the Query component handles the data fetching we need to make sure we properly deal with the cases of a loading state as well as when the receive Errors from the GraphQL API. In this lesson we will cover both.
You query ID and title, then you have the data returned. Where is this data stored ? in json file ? would be nice to see also that step where you link data to graphql...
@Vlad it's storred in Apollo's In-Memory Cache. You can find more info here: https://www.apollographql.com/docs/react/advanced/caching.html
Hey @Nik question in which case would we use <ApolloConsumer>
then? Do we normally use Query
and not ApolloConsumer
?
Hey @Eleonore, apart from this example I have never used ApolloConsumer. I always used Query & Mutation.
There might be useful usecases, but so far I haven’t ran into them.