Where did createNetworkInterface go?
See original GitHub issuereact-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:
- Created 6 years ago
- Reactions:8
- Comments:7
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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)
Docs are now here https://www.apollographql.com/docs/react/recipes/2.0-migration.html