How to setState() in React/Apollo with graphQL

前端 未结 3 1759
醉话见心
醉话见心 2021-02-04 20:14

I am trying to setState() to a query result I have from graphQL, but I am having difficulty finding out how to do this because it will always be loading, or it\'s only used from

3条回答
  •  温柔的废话
    2021-02-04 20:42

    I had a similar issue (although it was happening for a totally different reason). My state kept getting set to undefined. I was able to solve it with a React middleware. It made it easy to avoid this issue. I ended up using superagent.

    http://www.sohamkamani.com/blog/2016/06/05/redux-apis/

提交回复
热议问题