apollostack - Apollo GraphQL: Child Component Re-Runs Parent Query? -
i've got parent component apollo query attached:
const withdata = graphql(my_query, { options({ userid }) { return { variables: { _id: userid} }; }, props({ data: { loading, getoneuser } }) { return { loading, getoneuser }; }, }); export default compose( withdata, withapollo )(navigatorslist); export { getoneuser_query }; i've got child component called userphoto embedded in render function:
return ( <div> <userphoto /> [.....] </div> ) without child component, withdata graphql function runs twice, once loading == true, , 1 more time data returned.
with child component included, withdata graphql function runs three times. third time getoneuser undefined , component throws error.
how can correct this?
thanks in advance info.
fixed. there syntax error in child component wasn't throwing error, causing query run twice + assorted other anomalies.
Comments
Post a Comment