Added routing and basic board component.
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { gql } from "apollo-boost";
|
||||
import { GET_CURRENT_USER } from "./local.queries";
|
||||
import { GET_CURRENT_USER, GET_WHITE_BOARD_LEFT_SIDER_VISIBLE } from "./local.queries";
|
||||
|
||||
export const typeDefs = gql`
|
||||
extend type Mutation {
|
||||
SetCurrentUser(user: User!): User!
|
||||
ToggleWhiteBoardLeftSiderVisible: Boolean!
|
||||
}
|
||||
|
||||
extend type User {
|
||||
@@ -22,6 +23,20 @@ export const resolvers = {
|
||||
});
|
||||
|
||||
return user;
|
||||
}
|
||||
},
|
||||
|
||||
toggleWhiteBoardLeftSiderVisible: (_root, _args, { cache }) => {
|
||||
const { whiteBoardLeftSiderVisible } = cache.readQuery({
|
||||
query: GET_WHITE_BOARD_LEFT_SIDER_VISIBLE
|
||||
});
|
||||
|
||||
cache.writeQuery({
|
||||
query: GET_WHITE_BOARD_LEFT_SIDER_VISIBLE,
|
||||
data: { whiteBoardLeftSiderVisible: !whiteBoardLeftSiderVisible }
|
||||
});
|
||||
|
||||
return !whiteBoardLeftSiderVisible;
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user