Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting numPendingQueries value always 0 on React Native #44

Closed
borasumer opened this issue May 15, 2021 · 4 comments
Closed

Getting numPendingQueries value always 0 on React Native #44

borasumer opened this issue May 15, 2021 · 4 comments

Comments

@borasumer
Copy link

Hi, not even sure if it is because React Native, but for some reason getting this status all the time, not sure what I am missing.

status: Object {
  "mutationError": undefined,
  "numPendingMutations": 0,
  "numPendingQueries": 0,
  "queryError": undefined,
}

This is also my linking setup for Apollo client

const { link } = createNetworkStatusNotifier();

const authLink = setContext(async (_, { headers }) => {
  const token = await SecureStore.getItemAsync('accessToken');
  return {
    headers: {
      ...headers,
      authorization: token && `${token}`,
    },
  };
});

const client = new ApolloClient({
  link: authLink.concat(link.concat(httpLink)),
  cache: new InMemoryCache(),
});

@borasumer
Copy link
Author

Yeah I think this is an apollo version issue. I am using 2.6.10. Which latest version of this library does support apollo 2.6.10?
Thanks

@amannn
Copy link
Member

amannn commented May 15, 2021

Hi @borasumer,

right, as you're saying this looks like an issue with the Apollo version you're using. Please have a look at the changelog to see which version of this library is supported for which Apollo version.

Please also note that older versions might have bugs that are already resolved and not all the latest features are supported. Ideally you'd upgrade both Apollo and this library to the latest version.

I'll close this for now, but please let me know if you have any issues with the latest version.

@amannn amannn closed this as completed May 15, 2021
@borasumer
Copy link
Author

Hi @amannn, I have updated both apollo-client and this library to their latest versions but still getting this value as 0. Not sure what I am missing, again I am using React Native on Expo, wonder if that could create a limitation, I doubt though.

@amannn
Copy link
Member

amannn commented May 16, 2021

Hmm, interesting. Maybe you're seeing this issue? #19

Otherwise I don't really know what's causing this. React Native should work equally well, since this library only integrates with Apollo Client itself and doesn't access any platform features like fetch.

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

No branches or pull requests

2 participants