Could not find "client" in the context or passed in as an option

I am learning to use Slash GraphQL, And I try to build a React UI based on this document (GraphQL Queries in Apollo React - Courses)
I load the Schema and Data into Slash GraphQL, down the app boilerplate , run the GraphQL Code Generator.
So far everything is going well, But when I try to follow the tutorial to run the code (yarn start), I get an error

Could not find "client" in the context or passed in as an option. Wrap the root component in an <ApolloProvider>, or pass an ApolloClient instance in via options.
new InvariantError
   9 | export class InvariantError extends Error {
  10 |   framesToPop = 1;
  11 |   name = genericMessage;
> 12 |   constructor(message: string | number = genericMessage) {
  13 |     super(
  14 |       typeof message === "number"
  15 |         ? `${genericMessage}: ${message} (see`
View compiled
  24 |   message?: string | number,
  25 | ): asserts condition {
  26 |   if (!condition) {
> 27 |     throw new InvariantError(message);
  28 |   }
  29 | }
  30 | 
View compiled


import React from "react"
import ReactDOM from "react-dom"
import { App } from "./App";
import {ApolloClient, createHttpLink, InMemoryCache, ApolloProvider} from '@apollo/client'
import * as serviceWorker from "./serviceWorker"
import "semantic-ui-css/semantic.min.css"
import "./index.css"
import "./styles/main.css"

  <App />, 

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers:
const createApolloClient = () => {
  const httpLink = createHttpLink({
    uri: "",
  return new ApolloClient({
    link: httpLink,
    cache: new InMemoryCache(),

  <ApolloProvider client={createApolloClient()}>
      <App />


slash-graphql backends

slash-graphql list-backends
Id     Name        Endpoint                                                    
0x716d My Todo App   
0x722d Test 

Please help me to solve this problem, thanks

Did you manage to solve this?

I am not a react guy nor apollo (If you still have problems you might want to look into urql which is must faster), but your code looks a little different than the dgraph template.


Hi, Please I’d like to know if you were able to solve this. I’m faceing the same issue and can’t find a solution.