summaryrefslogtreecommitdiffstats
path: root/frontend/lib
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2018-02-15 16:59:58 -0500
committerWes Bos <wesbos@gmail.com>2018-02-15 16:59:58 -0500
commit8f2c595eca30e2d7138c8e8d6685774a8f44e55d (patch)
tree3408b9c8eb3b0ea43cb72e13e0bd6393ab5bac61 /frontend/lib
parenta09b01abf7c03e6b7e43f2175e5a34501808821b (diff)
omg
Diffstat (limited to 'frontend/lib')
-rw-r--r--frontend/lib/image.js6
-rw-r--r--frontend/lib/initApollo.js15
2 files changed, 7 insertions, 14 deletions
diff --git a/frontend/lib/image.js b/frontend/lib/image.js
deleted file mode 100644
index 5b6efb9..0000000
--- a/frontend/lib/image.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import { imageEndpoint } from '../config';
-
-export default function(image, width = 300, height = 300) {
- if (!image || !image.secret) return '';
- return `${imageEndpoint}/${image.secret}/${width}x${height}`;
-}
diff --git a/frontend/lib/initApollo.js b/frontend/lib/initApollo.js
index 45f0fec..e86c7e1 100644
--- a/frontend/lib/initApollo.js
+++ b/frontend/lib/initApollo.js
@@ -20,20 +20,19 @@ function create(initialState) {
const stateLink = withClientState({
cache,
defaults: {
- networkStatus: {
- __typename: 'NetworkStatus',
+ uiData: {
+ __typename: 'UIData',
isConnected: true,
- isCartOpen: true,
+ isCartOpen: false,
},
},
resolvers: {
Mutation: {
- updateNetworkStatus: (_, { isConnected }, { cache }) => {
- console.log(isConnected);
+ setLocalData: (_, values, { cache }) => {
const data = {
- networkStatus: {
- __typename: 'NetworkStatus',
- isConnected,
+ uiData: {
+ __typename: 'UIData',
+ ...values,
},
};
cache.writeData({ data });