summaryrefslogtreecommitdiffstats
path: root/frontend/lib/withData.js
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2018-05-11 12:31:49 -0400
committerWes Bos <wesbos@gmail.com>2018-05-11 12:31:49 -0400
commitd3838ccb799cd8c286efcea90d776e8b6936d484 (patch)
tree4430ea2ada80b1fefb057adfce91867484be7475 /frontend/lib/withData.js
parent8ccb0d93cdc064776454c929e15aa03129be37a3 (diff)
move apollo to _app
Diffstat (limited to 'frontend/lib/withData.js')
-rw-r--r--frontend/lib/withData.js3
1 files changed, 2 insertions, 1 deletions
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 });