我正在使用Apollo Client作为前端,使用Graphcool作为后端.有两个查询firstQuery和secondQuery我希望他们在序列页面打开时调用.下面是示例代码(此处未列出TestPage组件的定义):
export default compose(
graphql(firstQuery, {
name: 'firstQuery'
}),
graphql(secondQuery, {
name: 'secondQuery' ,
options: (ownProps) => ({
variables: {
var1: *getValueFromFirstQuery*
}
})
})
)(withRouter(TestPage))
Run Code Online (Sandbox Code Playgroud)
我需要var1在secondQuery从的结果firstQuery.我如何使用Apollo Client和编写?或者还有其他方法吗?提前致谢.