graphql resolver args code example
Example 1: query sequnce graphql
{({ data: { someQuery: { someValue } = {} } = {} }) => (
{({ data: secondQueryData }) => (
// your component here
)}
Example 2: query sequnce graphql
export default compose(
graphql(firstQuery, {
name: 'firstQuery'
}),
graphql(secondQuery, {
name: 'secondQuery',
skip: ({ firstQuery }) => !firstQuery.data,
options: ({firstQuery}) => ({
variables: {
var1: firstQuery.data.someQuery.someValue
}
})
})
)(withRouter(TestPage))