Hi,
I’m using apollo client with react, and am using useQuery hooks. In my application I have two sequential requests:
query GetSectionByLocation($location: route_bool_exp) {
route(where: $location) {
id
section {
id
name
templateByTemplate {
id
name
component
}
}
}
}
and
query ExampleQuery($where: section_bool_exp) {
section(where: $where) {
id
name
}
}
I’d expect the second request to retrieve the data from the cache, however it instead makes a second request to the database even though the data being requested is already in the cache.
How can I make the second request get the data from the cache? Is it possible to do this with the useQuery hook?
I’ve already tried setting the fetch policy to cache-only, which hasn’t worked (it doesn’t return anything)
Thanks