Added routing and basic board component.
This commit is contained in:
@@ -5,5 +5,6 @@ export default {
|
||||
token: null
|
||||
},
|
||||
selectedNavItem: "Home",
|
||||
recentItems: []
|
||||
recentItems: [],
|
||||
whiteBoardLeftSiderVisible: true
|
||||
};
|
||||
|
||||
@@ -15,3 +15,9 @@ export const GET_CURRENT_USER = gql`
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_WHITE_BOARD_LEFT_SIDER_VISIBLE = gql`
|
||||
{
|
||||
whiteBoardLeftSiderVisible @client
|
||||
}
|
||||
`;
|
||||
@@ -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