Fix login/logout flow

This commit is contained in:
Chocobozzz
2019-01-18 14:47:10 +01:00
parent 80c6351d2f
commit cbdcdd005d
15 changed files with 307 additions and 1331 deletions

25
js/src/apollo/user.ts Normal file
View File

@@ -0,0 +1,25 @@
export const currentUser = {
defaults: {
currentUser: {
__typename: 'CurrentUser',
id: null,
email: null,
},
},
resolvers: {
Mutation: {
updateCurrentUser: (_, { id, email }, { cache }) => {
const data = {
currentUser: {
id,
email,
__typename: 'CurrentUser',
},
};
cache.writeData({ data });
},
},
},
};