From 8f2c595eca30e2d7138c8e8d6685774a8f44e55d Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Thu, 15 Feb 2018 16:59:58 -0500 Subject: omg --- frontend/lib/initApollo.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'frontend/lib/initApollo.js') 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 }); -- cgit v1.3