Showing
6 changed files
with
12 additions
and
9 deletions
1 | import React from "react"; | 1 | import React from "react"; |
2 | -import { gql } from "apollo-boost"; | 2 | +import gql from "graphql-tag"; |
3 | import { useQuery } from "@apollo/react-hooks"; | 3 | import { useQuery } from "@apollo/react-hooks"; |
4 | import { ThemeProvider } from "styled-components"; | 4 | import { ThemeProvider } from "styled-components"; |
5 | import GlobalStyles from "../Styles/GlobalStyles"; | 5 | import GlobalStyles from "../Styles/GlobalStyles"; |
... | @@ -15,9 +15,12 @@ const QUERY = gql` | ... | @@ -15,9 +15,12 @@ const QUERY = gql` |
15 | `; | 15 | `; |
16 | 16 | ||
17 | export default () => { | 17 | export default () => { |
18 | - const { | 18 | + const { data } = useQuery(QUERY); |
19 | - data: { isLoggedIn }, | 19 | + let isLoggedIn; |
20 | - } = useQuery(QUERY); | 20 | + |
21 | + if (data !== undefined) { | ||
22 | + isLoggedIn = data.isLoggedIn; | ||
23 | + } | ||
21 | 24 | ||
22 | return ( | 25 | return ( |
23 | <ThemeProvider theme={Theme}> | 26 | <ThemeProvider theme={Theme}> | ... | ... |
1 | import React from "react"; | 1 | import React from "react"; |
2 | import { useMutation } from "@apollo/react-hooks"; | 2 | import { useMutation } from "@apollo/react-hooks"; |
3 | -import { gql } from "apollo-boost"; | 3 | +import gql from "graphql-tag"; |
4 | import MenuPresenter from "./MenuPresenter"; | 4 | import MenuPresenter from "./MenuPresenter"; |
5 | 5 | ||
6 | const LOG_OUT = gql` | 6 | const LOG_OUT = gql` | ... | ... |
-
Please register or login to post a comment