Use apolloclient on server


#1

I’m building a isomorphic app that does server side rendering, wen I try to use the apollo client on the server side like:

import ApolloClient from 'apollo-client';
import {meteorClientConfig} from 'meteor/apollo';

const client = new ApolloClient(meteorClientConfig());

It fails, server command line log shows that meteorClientConfig is not a function.

Wen I put a condition

var client = {};
if(Meteor.isClient){
    client = new ApolloClient(meteorClientConfig());
    console.log(client);
}

It works but that means the server cant access the db, only the browser.