apollo-client

How to chain two GraphQL queries in sequence using Apollo Client

£可爱£侵袭症+ 提交于 2019-11-26 14:00:10
问题 I am using Apollo Client for the frontend and Graphcool for the backend. There are two queries firstQuery and secondQuery that I want them to be called in sequence when the page opens. Here is the sample code (the definition of TestPage component is not listed here): export default compose( graphql(firstQuery, { name: 'firstQuery' }), graphql(secondQuery, { name: 'secondQuery' , options: (ownProps) => ({ variables: { var1: *getValueFromFirstQuery* } }) }) )(withRouter(TestPage)) I need to get