This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { compose } from 'react-apollo'; | |
import { graphql, gql } from 'apollo-boost'; | |
/* Let's assume Authors and Books are retrieved with separate queries, resulting in 2 HOCs */ | |
const withAuthorsQuery = graphql(gql`... some query...`, { name: 'authorsQuery' }); | |
const withBooksQuery = graphql(gql`... some other query...`, { name: 'booksQuery' }); | |
/* Now we want to use a third party component needs books and authors */ | |
const ThirdPartyComponent = ({ books, authors }) => (<div>books: {books} authors: {authors}</div>); |