question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Where did createNetworkInterface go?

See original GitHub issue

react-apollo docs mentions I import createNetworkInterface from react-apollo:

import { ApolloClient, createNetworkInterface } from 'react-apollo';
const networkInterface = createNetworkInterface({
  uri: 'http://api.example.com/graphql'
});
const client = new ApolloClient({
  networkInterface: networkInterface
});

However that wasn’t working, as I’m getting Uncaught TypeError: (0 , _reactApollo.createNetworkInterface) is not a function. [After a bit of reading](https://github.com/apollographql/apollo-client/issues/108), it appears the docs is incorrect or out of date, and instead I should try importing it from apollo-client`

Then apollo-client docs mention:

import ApolloClient, { createNetworkInterface } from 'apollo-client';
const networkInterface = createNetworkInterface({ uri: 'https://example.com/graphql' });
const client = new ApolloClient({
  networkInterface,
});

That also doesn’t work, failing with the same ‘not a function’ error as before. Grepping through the apollo-code i have in node_modules, I can’t find any mention of createNetworkInterface.

I have apollo-client@2.0.1 and `react-apollo@2.0.0 installed.

Where am I supposed to get it from? What am I doing wrong?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:7

github_iconTop GitHub Comments

16reactions
qswitchercommented, Nov 2, 2017

createNetworkInterface was removed in 2.x. Refer to the upgrade docs and new documentation https://github.com/apollographql/apollo-client/blob/master/Upgrade.md

docs: https://www.apollographql.com/docs/react/ (linked on project README)

9reactions
qswitchercommented, Mar 4, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

CreateNetworkInterface - Amazon Elastic Compute Cloud
This example creates a network interface in the specified subnet with a primary IPv4 address that is automatically selected by Amazon EC2. Sample...
Read more >
AWS Lambda:The provided execution role does not have ...
This error is common if you try to deploy a Lambda in a VPC ... ec2:CreateNetworkInterface , and ec2:DeleteNetworkInterface (see AWS Forum).
Read more >
create-network-interface-permission - Amazon AWS
The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON...
Read more >
Create, change, or delete an Azure network interface
Learn what a network interface is and how to create, change settings for, ... Screenshot of create network interface in Azure portal.
Read more >
aws ec2 create-network-interface - Fig.io
--dry-run, Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found