Slide 31
Slide 31 text
function mapQueriesToProps({ watchQuery, ownProps, state }) {
return {
category: watchQuery({
query: `
query getCategory($categoryId: Int!) {
category(id: $categoryId) {
name
color
}
}
`,
variables: {
categoryId: 5,
},
forceFetch: false,
returnPartialData: true,
})
}
}
const CategoryContainer = connect({
mapQueriesToProps,
})(Category);