I have a problem passing in the variable options into the graphql query. If console.log(ownProps.match.params.id) I get the correct id.
However im getting this error:
Error: The operation 'selectCustomer' wrapping 'Apollo(Apollo(withRouter(Consumer)))' is expecting a variable: 'id' but it was not found in the props passed to 'Apollo(Apollo(Apollo(withRouter(Consumer))))'
Export
const ConsumerWithMutations = graphql(selectCustomer, {
name : 'selectCustomer',
options: (ownProps) => ({
variables: {
id: ownProps.match.params.id
}
})
})(graphql(deleteCustomer, {
name: 'deleteCustomer'
})(withRouter(Consumer)))
export default graphql(selectCustomer)(ConsumerWithMutations);
Query
const selectCustomer = gql`
query selectCustomer($id: String!)
{
consumer(id: $id) {
id
firstname
lastname
dateOfBirth
...