Loading stuck on true when using useLazyQuery in React

Hey fellas,

i’m using useLazyQuery to login to the server. it was working great until today. It suddenly stopped working. I see a request to the server is being made and I get a response from the server. however, data/error values are still undefined and loading is still true.

    const [login, { loading, error, data }] = useLazyQuery(LOGIN, { fetchPolicy: 'no-cache' });
    login({ variables: { access_key: values.username, access_secret_key: values.password } });

This is how I use the query inside my code.

setting notifyOnNetworkStatusChange: true does not solve the issue.

Does anybody have a solution? :pray:

Did you upgrade to the latest version of apollo-client 3.6.0?
Check out their changelog:
apollo-client/CHANGELOG.md at 88be842eed39bf94fc3c83ea9c4135e5458809f0 · apollographql/apollo-client · GitHub for relevant changes

I’m facing similar issue (for useQuery) on v 3.0.6 - the component is stuck in loading state in the unit tests

I solved it by changing the login query to a mutation in the server.
For some reason it seems like a mutation works better