In progress sign in changes.

This commit is contained in:
Patrick Fic
2019-12-04 21:02:23 -07:00
parent 25d434ef10
commit b2649a25cc
8 changed files with 203 additions and 23 deletions

View File

@@ -0,0 +1,26 @@
import { gql } from "apollo-boost";
export const typeDefs = gql`
extend type Mutation {
SetCurrentUser(user: User!): User!
}
`;
const GET_CURRENT_USER = gql`
{
currentUser @client
}
`;
export const resolvers = {
Mutation: {
setCurrentUser: (_root, { user }, { cache }) => {
cache.writeQuery({
query: GET_CURRENT_USER,
data: { currentUser: user }
});
return user;
}
}
};