0

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.

https://i.stack.imgur.com/DpRN5.jpg

1 Answers1

0

I just tried to clone & run your project but it fails almost immediately because of missing packages. Does master have all your latest commits ?

In the meantime, can you post here the detail of your error ?

Gildas

Gildas Garcia
  • 6,966
  • 3
  • 15
  • 29