pbassut
05/31/2017, 10:44 PMmartin
05/31/2017, 11:57 PMuser
property in the first component as part of a filter variable?
This throws an error (user
comes up as undefined):
export default graphql(userQuery, { options: { fetchPolicy: 'cache-and-network' } })(
graphql(getContacts, {
options: ({ user }) => ({
variables: { contactFilter: { contactToUser: { id: user.id } } },
fetchPolicy: 'cache-and-network'
})
})(Main)
)
But when I put the getContacts
query on its own in another react component that’s called from that above react component, it works. Like this:
Parent component:
export default graphql(userQuery, { options: { fetchPolicy: 'cache-and-network' } })(Main)
Child component:
export default graphql(getContacts, {
options: ({ user }) => ({
variables: { contactFilter: { contactToUser: { id: user.id } } },
fetchPolicy: 'cache-and-network'
})
})(ChildComponent)
fourcolors
06/01/2017, 12:10 AMpbassut
06/01/2017, 12:29 AMfourcolors
06/01/2017, 12:31 AMpbassut
06/01/2017, 12:35 AMpbassut
06/01/2017, 12:35 AMyus
06/01/2017, 1:25 AMyus
06/01/2017, 1:27 AMyus
06/01/2017, 1:28 AMyus
06/01/2017, 1:29 AMpbassut
06/01/2017, 1:47 AMpbassut
06/01/2017, 1:50 AMpbassut
06/01/2017, 1:51 AMpbassut
06/01/2017, 1:51 AMresponse.body
which might not be what you want. But it must be resolve to somethingyus
06/01/2017, 2:00 AMyus
06/01/2017, 2:02 AMyus
06/01/2017, 2:03 AMpbassut
06/01/2017, 2:04 AMpbassut
06/01/2017, 2:05 AMyus
06/01/2017, 2:21 AMyus
06/01/2017, 3:23 AMuser
06/01/2017, 3:23 AMwallslide
06/01/2017, 4:18 AMyus
06/01/2017, 4:21 AMwallslide
06/01/2017, 4:22 AMyus
06/01/2017, 4:22 AMyus
06/01/2017, 4:22 AMwallslide
06/01/2017, 4:23 AMyus
06/01/2017, 4:24 AM