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 7530f1b2d382b135fb912413d8d3b81e7326a6f1 · 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