Closed acomito closed 7 years ago
👋 hey @acomito, thanks for filing an issue!
Firstly, you don't need to add a custom dataIdFromObject
, the latest apollo-client
normalizes the store with _id
when it sees one (see code) 🎉
And the error you get is because it tries to use a method from a NetworkInterface
, but you pass is just an object with two keys 😄 Check how to use createMeteorNetworkInterface
if you want to customize the interface anyway!
Happy hacking! 👍
Thank you @xavcz
@xavcz is there any way to test locally on iphone/safair? I can't seem to connect via my:
const networkInterface = createMeteorNetworkInterface({
uri: '00.0.0.000:3000/graphql',
});
const options = {
connectToDevTools: true,
networkInterface
};
const config = meteorClientConfig(options)
const client = new ApolloClient(config);
My iphones plugged in to my macbook, but I can't seem to hit localhost:3000 or my IP:3000. I'm getting my HTML, but not server for login.
Update:
needed the write meteor/npm startup script to set the port:
"scripts": {
"start": "meteor --port 000.000.00.00:3000 --settings settings-development.json ",
then correct client-side setup:
const networkInterface = createMeteorNetworkInterface({
uri: 'http://000.000.00.00:3000/graphql',
});
const options = {
connectToDevTools: true,
networkInterface
};
const config = meteorClientConfig(options)
const client = new ApolloClient(config);
export default client;
then good to go
Waow cool!
I'm hoping to make sure my dataIdFromObject is setup for meteor's _id but keep getting an error when I try this: