summaryrefslogtreecommitdiffstats
path: root/frontend/lib
diff options
context:
space:
mode:
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 });