Launch Graph Manager


API reference


npm install @apollo/react-common


dataTDataAn object containing the result of your GraphQL subscription. Defaults to an empty object.
loadingbooleanA boolean that indicates whether any initial data has been returned
errorApolloErrorA runtime error with graphQLErrors and networkError properties


One way to access the configured Apollo Client instance directly is to create an ApolloConsumer component and provide a render prop function as its child. The render prop function will be called with your ApolloClient instance as its only argument. You can think of the ApolloConsumer component as similar to the Consumer component from the React Context API.


import React from 'react';
import { ApolloConsumer } from '@apollo/react-common';
// or from the hooks, components, hoc packages:
// import { ApolloConsumer } from "@apollo/react-hooks";

const WithApolloClient = () => (
    {client => 'We have access to the client!' /* do stuff here */}
Edit on GitHub