我在react
中的render函数中有以下代码let newCat
this.props.client.query({
query: queryCategoriesForCategoryListPage,
name: 'fetchCategories',
variables: {
incubatorId: this.props.getCurrentUser.currentUser.incubator._id
}
}).then((cat)=>{
console.log("cat resolved is: ",cat)
if(cat.data && cat.data.categories)
newCat = cat.data.categories
})
console.log("newCat is: ",newCat)