React-apollo: `createNetworkInterface` in @2.0.0 ?

Created on 25 Oct 2017  路  11Comments  路  Source: apollographql/react-apollo

Hi,

First of all, congrats for the great work you're doing with Apollo and its integration with React
馃憣馃徎 馃挅 馃巿

Intended outcome

Following the first step from the React-Apollo HowToGQL tutorial, I wanted to have an instance of Apollo Client running.

Actual outcome

I get undefined when trying to import createNetworkInterface from react-apollo:

import { createNetworkInterface } from 'react-apollo'

This seems to happen because react-apollo@2.*.* doesn't export createNetworkInterface anymore. I couldn't find this explicitly documented neither on the README or on the docs.

When you run yarn add react-apollo it installs 2.0.0.

How to reproduce the issue

https://codesandbox.io/s/oqz905xwn6

Versions

Most helpful comment

So createNetworkInterface is deprecated in favor of apollo-link and apollo-link-http

I think we need to wait for some more migration docs :)

All 11 comments

I fix this problem using the latest release version from this repo, 1.4.15.
Update your package.json and change the version of react-apollo to 1.4.15.
For now all works pretty well.
I think that before release a new version on npm, the package should be tested.. but seems that react-apollo v2.0.0 is in beta. (??)

react-apollo doesn't export gql anymore either.

I don't think this is intentional because 2.0 was supposed to have no breaking changes and there is zero documentation on these things being taken out.

So createNetworkInterface is deprecated in favor of apollo-link and apollo-link-http

I think we need to wait for some more migration docs :)

For others stumbling on this - here's a PR migrating the examples to the v2 api.

@wesbos I think the removal of gql might have been intentional. In the "After" example here, they show importing gql from graphql-tag

@mwickett great, I think everything is explained in the docs section you linked 馃帄

I think we can close this issue 馃憤馃徎

So createNetworkInterface is deprecated in favor of apollo-link and apollo-link-http

Deprecated, but still used in demo docs. https://github.com/apollographql/react-docs/blob/master/source/server-side-rendering.md

Hi,
I'm trying to use createNetworkInterface from 'react-apollo' but it show
screenshot from 2018-12-22 00-21-23

how can I fix?

For others stumbling on this - here's a PR migrating the examples to the v2 api.

unfortunately this link doesn't work anymore, along with any other link found anywhere. Why would anyone delete a migration document?

Was this page helpful?
0 / 5 - 0 ratings