Justification is that, this hook sits on a top-level component and it only ever makes a network request again when the colonyName changes i.e. when you switch Colonies.
colonyName is plucked directly from the URL via useParams() so it should remain constant whilst you're browsing the same Colony.
The issue is that nextFetchPolicy is causing the useGetFullColonyByNameQuery() hook to make the request twice as soon at it gets invoked:
} = useGetFullColonyByNameQuery({
variables: {
name: colonyName,
},
fetchPolicy: 'network-only',
nextFetchPolicy: 'cache-only' // <<-- This one
});
Description
The issue is that
nextFetchPolicy
is causing theuseGetFullColonyByNameQuery()
hook to make the request twice as soon at it gets invoked:Which then causes this component to render twice:
Testing
Resolves #3662