I have a query like this:
const { data } = useQuery(GET_STUFF, {
fetchPolicy: "cache-only",
})
This works fine in the code. In the tests data is undefined
but I've mocked it like so:
{
request: {
query: GET_STUFF,
},
result: {
data: {
__a: {
id: "12",
},
},
},
},
but when I change fetchPolicy to fetchPolicy: "network-only" it then comes through as the expected result.
The problem also is I can't also pass cache into <MockedProvider /> as I have queries on that page that also use network-only
How do I solve this or throw stuff automatically into the cache?