Skip to main content

Using Subscriptions with React


Hook designed to be used for GraphQL Subscriptions.

For more configuration of Subscriptions check here.


  • Subscribe on-demand
  • Automatic unsubscribe on component unmount
  • Automatic updates on cache changes


import { useSubscription } from '../gqless';
export function Example() {
const { newNotification } = useSubscription();
if (newNotification) {
return (
New Notification: <b>{newNotification}</b>
return <p>Waiting for new notifications...</p>;
Last updated on by github-actions[bot]