Showing
1 changed file
with
8 additions
and
7 deletions
1 | import gql from "graphql-tag"; | 1 | import gql from "graphql-tag"; |
2 | 2 | ||
3 | -const clientQuery = gql` | ||
4 | - { | ||
5 | - isLoggedIn @client | ||
6 | - } | ||
7 | -`; | ||
8 | - | ||
9 | export const defaults = { | 3 | export const defaults = { |
10 | isLoggedIn: Boolean(localStorage.getItem("token") || false), | 4 | isLoggedIn: Boolean(localStorage.getItem("token") || false), |
11 | }; | 5 | }; |
... | @@ -33,6 +27,13 @@ export const resolvers = { | ... | @@ -33,6 +27,13 @@ export const resolvers = { |
33 | }, | 27 | }, |
34 | }, | 28 | }, |
35 | Query: { | 29 | Query: { |
36 | - clientQuery, | 30 | + checkLogIn: (_, __) => { |
31 | + const query = gql` | ||
32 | + { | ||
33 | + isLoggedIn @client | ||
34 | + } | ||
35 | + `; | ||
36 | + return query; | ||
37 | + }, | ||
37 | }, | 38 | }, |
38 | }; | 39 | }; | ... | ... |
-
Please register or login to post a comment