diff options
| author | Wes Bos <wesbos@gmail.com> | 2018-05-11 12:31:49 -0400 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2018-05-11 12:31:49 -0400 |
| commit | d3838ccb799cd8c286efcea90d776e8b6936d484 (patch) | |
| tree | 4430ea2ada80b1fefb057adfce91867484be7475 /frontend/lib | |
| parent | 8ccb0d93cdc064776454c929e15aa03129be37a3 (diff) | |
move apollo to _app
Diffstat (limited to 'frontend/lib')
| -rw-r--r-- | frontend/lib/withData.js | 3 |
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 }); |
