mobilizon/js/src/apollo/user.ts

26 lines
440 B
TypeScript
Raw Normal View History

2019-01-18 14:47:10 +01:00
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 });
},
},
},
};