In the example below MeQuery will override EntitiesQuery and the entities prop will never be passed to Component. You can switch the two around and the reverse will happen, so whatever comes last overrides the previous query. Am I missing anything here? Thanks.
const EntitiesQuery = gql`query Entities {
entities {
id
name
}
}`
const MeQuery = gql`query Me {
me {
username
id
}
}`
const Container = compose(
graphql(EntitiesQuery),
graphql(MeQuery),
)(Component);
I'm on 0.8.3 btw.
nvm, you've gotta specify the name, e.g:
const Container = compose(
graphql(EntitiesQuery, { name: 'EntitiesQuery' }),
graphql(MeQuery, { name: 'MeQuery' }),
)(Component);
Then instead of accessing them off props.data e.g. props.data.me you just go props.MeQuery.me.
Weird... I'm using this approach but the responses for both queries are nested. In your example, some results of EntitiesQuery are returned in MeQuery. Have you ever had this issue?
Doing Same, but get only the latest query result.
I'm having the same issue as @thisbejim.
Most helpful comment
nvm, you've gotta specify the name, e.g:
Then instead of accessing them off
props.datae.g.props.data.meyou just goprops.MeQuery.me.