apollo-redux-form icon indicating copy to clipboard operation
apollo-redux-form copied to clipboard

Update apollo-redux-form to Apollo 2

Open kavink opened this issue 7 years ago • 5 comments

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 ?

kavink avatar Dec 03 '17 05:12 kavink

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.

mstn avatar Dec 03 '17 11:12 mstn

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

kavink avatar Dec 03 '17 19:12 kavink

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.

mstn avatar Dec 08 '17 10:12 mstn

@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.

develomark avatar Jan 03 '18 11:01 develomark

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

mstn avatar Jan 03 '18 12:01 mstn