react-apollo icon indicating copy to clipboard operation
react-apollo copied to clipboard

useLazyQuery with refetch doesn't trigger onCompleted - URGENT

Open unutoiul opened this issue 5 years ago • 3 comments

i'm using

 "@apollo/client": "^3.0.0-beta.50",

useLazyQuery with refetch doesn't trigger onCompleted

when i modify the fetchPolicy in here:

export const client = new ApolloClient({
    version: '1',
    resolvers: {},
    cache: cache,
    link: ApolloLink.from([
        errorLink,
        authLink,
        ApolloLink.split(hasSubscriptionOperation, wsLink, httpLink),
    ]),
    queryDeduplication: false,
    defaultOptions: {
        watchQuery: {
            fetchPolicy: 'network-only',
        },
    },
});

onComplete is causing repeatly in an infinite loop the call

Huge BUG

unutoiul avatar Jun 01 '20 18:06 unutoiul

not only Lazy queries... normal queries does that too... Please tag me if find any solution 🙏🏼

ArtGurianov avatar Jun 03 '20 23:06 ArtGurianov

no solution so far...any react-apollo people can answer to this ISSUE?

unutoiul avatar Jun 04 '20 11:06 unutoiul

no solution but "apollo-client": "^2.6.10" doesn't show this problems. As for refetch is a promise,you can try refetch().then().

millievn avatar Jun 24 '20 06:06 millievn