Fundflow / apollo-redux-form

Redux forms powered by Apollo
MIT License
47 stars 7 forks source link

Update apollo-redux-form to Apollo 2 #45

Open kavink opened 6 years ago

kavink commented 6 years ago

Does apollo-redux-form work with Apollo 2.X ? or only works with 1.X ? Mainly because Apollo 2.X does not use redux, So if this works, please can someone point me to an example ?

mstn commented 6 years ago

Hi, thanks for your question. We have not tried Apollo 2, yet. The dependency on redux comes from the use of redux-form more than from Apollo. So my unverified guess is that you should be able to use whatever you want for Apollo state along with redux and redux-form.

kavink commented 6 years ago

@mstn Thanks, But wont be able to use apollo-redux-form as it still depends on 1.X ?

mstn commented 6 years ago

I am not able try it out on my own any time soon, but you can try to add apollo 2 as a peer dependency to this package

"react-apollo": "^1.4.14 | ^2.0.0"

and create a simple demo following the examples you can find in the storybook without connecting Apollo 2 to Redux. It could work.

develomark commented 6 years ago

@mstn I've tried this out. It works - in fact, it still works if the user is still on 1.4.

Updated apollo-client, apollo-cache-inmemory, apollo-link-http, react-apollo, graphql-tag, graphql to latest.

The main issue is that all your tests no longer work as the ApolloProvider api is different in 2.0; also mockNetworkInterface is no longer relevant.

It should be fairly simple to upgrade these tests.

mstn commented 6 years ago

Thanks for checking it out. As first step it would be enough to add the peer dependency with OR operator.