DEV Community

Przemek Nowak
Przemek Nowak

Posted on • Updated on

ApolloClient - React useSuspenseQuery hook

If some of you need hook to collaborate with React Suspense and Apollo Client - I've created one.

According to discussion on Apollo github - Apollo Client 3 won't have such a hook in first version. Yeah I know, Suspense is still in React experimental phase, but it looks like lot's of society started using it and it becomes an inseparable part of React. That's why I've created one and you can get it from this npm.

For now this hook is out of types, and still this code is not perfect, but it provide error handling and promise managing for Apollo.query. We tested it at Brainly on one of our prototype project and works fine.
Cheers!

Top comments (0)