Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

useLazyQuery with refetch doesn't trigger onCompleted - URGENT #4000

Open
unutoiul opened this issue Jun 1, 2020 · 3 comments
Open

useLazyQuery with refetch doesn't trigger onCompleted - URGENT #4000

unutoiul opened this issue Jun 1, 2020 · 3 comments

Comments

@unutoiul
Copy link

unutoiul commented Jun 1, 2020

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

@ArtGurianov
Copy link

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

@unutoiul
Copy link
Author

unutoiul commented Jun 4, 2020

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

@millievn
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants