Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
Triz_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sdy
2020-05-08 14:03:35 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1efb08d39f803a2633863364e2cfaa32d4aac2ad
1efb08d3
1 parent
a49fd8cb
update frontend gql
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
front/src/Apollo/ClientState.js
front/src/Apollo/ClientState.js
View file @
1efb08d
export
const
defaults
=
{};
export
const
defaults
=
{
isLoggedIn
:
Boolean
(
localStorage
.
getItem
(
"token"
)
||
false
),
};
export
const
resolvers
=
{};
export
const
resolvers
=
{
Mutation
:
{
logUserIn
:
(
_
,
{
token
},
{
cache
})
=>
{
localStorage
.
setItem
(
"token"
,
token
);
cache
.
writeData
({
data
:
{
isLoggedIn
:
true
,
},
});
return
null
;
},
logUserOut
:
(
_
,
__
,
{
cache
})
=>
{
localStorage
.
removeItem
(
"token"
);
window
.
location
.
reload
();
return
null
;
},
},
};
...
...
Please
register
or
login
to post a comment