Вот рабочий пример, правда тут вместо верхнего запроса используется connect redux, но смысл тот же самый, в данном случае из redux передается searchValue
const mapStateToProps = ({ navBar, auth }) => ({
searchValue: navBar.searchValue,
userId: auth.userId
})
const configObject = {
options: ({ endCursor, searchValue = '', ...props }) => ({
variables: {
first: 16,
after: endCursor || null,
searchValue
}
}),
force: true,
props
}
export default compose(
connect(mapStateToProps),
graphql(ALL_POSTS, configObject)
)(PostsList)