I used to use prevues version of where I could use connect to provide data and mutation methods to component like so:
export default connect({
mapQueriesToProps,
mapMutationsToProps,
})(component);
And in each mapQueriesToProps
and mapMutationsToProps
I could provide many instance for example 2-3 data queries and several mutation methods.
But how can I do it using following pattern in the new version?
export default graphql(data, {
options: ({ params: { id } }) => ({
variables: {
id: Number(id),
},
}),
})(component);
You could use compose
several times.
Compose all the mutations and all the queries and then compose them in your component.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.