Fix login/logout flow
This commit is contained in:
25
js/src/apollo/user.ts
Normal file
25
js/src/apollo/user.ts
Normal 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 });
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user