compose not exported from react-apollo

compose was removed from React Apollo 3.0.0. If you want to use the same HOC pattern, feel free to use the same copy of lodash's flowRight.

Install lodash in your client folder

npm install lodash 

and use this to import compose from lodash (use a capital R in flowRight)

import {flowRight as compose} from 'lodash';

Reference for the braking changes


Below is how I solved this issue with my project:

  1. install lodash.flowright

    npm install lodash.flowright

  2. import it in your AddBook.js or in the file that you want to use compose

    import compose from 'lodash.flowright'


compose was removed from React Apollo 3 (see the Breaking Changes). Now, to use compose, use lodash's flowRight.

Install flowright:

yarn add lodash.flowright

Replace in your code:

import { compose } from 'react-apollo'

by

import {flowRight as compose} from 'lodash';