Overview
I have a component that renders two child components. The child components uses apollo's useQuery
to issue a request to the server. The issue is because apollo-link-dedup
is included when using apollo-client
, only one request is being sent to the server.
I've tried setting the context to forceFetch: true
as specified here but this doesn't seem to work with hooks.
Here's the query:
// Generated query from @graphql-codegen/cli
import { useGetUploadUrlsQuery } from 'types/graphql'
useGetUploadUrlsQuery({
fetchPolicy: 'network-only',
context: {
forceFetch: true,
},
})
Note: Passing in a unique variable bypasses the dedup. Any less hacky solution/workaround that anyone can come up with will be helpful.
Thanks!