From d3838ccb799cd8c286efcea90d776e8b6936d484 Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Fri, 11 May 2018 12:31:49 -0400 Subject: move apollo to _app --- frontend/lib/withData.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'frontend/lib') diff --git a/frontend/lib/withData.js b/frontend/lib/withData.js index e419078..3210cf6 100644 --- a/frontend/lib/withData.js +++ b/frontend/lib/withData.js @@ -4,7 +4,7 @@ import { LOCAL_STATE_QUERY } from '../queries/queries'; // can also be a function that accepts a `headers` object (SSR only) and returns a config const client = new ApolloClient({ - uri: 'http://localhost:4444', + uri: process.env.NODE_ENV === 'development' ? 'http://localhost:4444' : 'http://localhost:4444', ssrMode: !process.browser, // Disables forceFetch on the server (so queries are only run once) request: operation => { // if we're in the client and the user has a token, send it along with the request @@ -33,6 +33,7 @@ const client = new ApolloClient({ }, }); +// TODO don't export client for page.js export { client }; export default withApollo({ client }); -- cgit v1.3