I have a queries file that looks like this:
import {gql} from \'react-apollo\';
const queries = {
getApps: gql`
{
apps {
id
name
Another way around this is to use the props
option.
export default compose(
graphql(QUERY_2, {
props: ({ data }) => ({ ...data }),
}),
graphql(QUERY_1, {
props: ({ data }) => ({ ...data, myCustomAttribute: data.foo }),
}),
)(Component);
I've found that this approach is a bit nicer for my use case.
Here is a link to the docs: https://www.apollographql.com/docs/react/api/react-apollo.html#graphql-config-props