I'm trying to use aor-simple-graphql-client for admin on rest with react-boilerplate.
I got a simple error trying to create the Apollo client.
File : App.js on admin
class App extends Component {
constructor() {
super();
this.state = { restClient: null };
}
componentDidMount() {
createRestClient().then((restClient) => this.setState({ restClient }));
}
render() {
const { restClient } = this.state;
if (!restClient) {
return <div>Loading</div>;
}
...
When I navigate to localhost/admin, i get an error Uncaught (in promise) ... restClient is never initialize. I'm pretty sure its a basic error, but i cant get it through.
Can someone can help me with that ?
My repo : https://github.com/romainquellec/cuistot
Thanks.
More on the error : Its maybe just a configuration error. I cant get the restClient initialized, liked componentDidMount is neved called.
I tried different methods, inspired on your project, with no results.