Не удалось найти «клиента» в контексте или передать как опору.Оберните корневой компонент в <ApolloProvider>, - PullRequest
0 голосов
/ 28 апреля 2019

приложению не удалось подключиться к клиенту

`
const client = new ApolloClient();
const root = document.querySelector("#root");
ReactDOM.render( 
 <div>
<ApolloProvider client={client}>
    <App />

    </ApolloProvider>,
<Router>
    <div>
        <Route exact path='/' component={App}/>
        <Route exact path='/edit/:id' component={Edit}/>
        <Route exact path='/create' component={Create}/>
        <Route exact path='/show/:id' component={Show}/>
    </div>
</Router>
 </div>,
`

Ошибка здесь ... Module ../ src / index.js src / index.js: 20 17 |18 |постоянный клиент = новый ApolloClient ();19 |const root = document.querySelector ("# root");

20 |ReactDOM.render (21 | 22 | 23 |

...