sdy

change apollo-boost to graphql-tag

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 { gql } from "apollo-boost"; 1 +import gql from "graphql-tag";
2 2
3 export const LOG_IN = gql` 3 export const LOG_IN = gql`
4 mutation login($email: String!, $password: String!) { 4 mutation login($email: String!, $password: String!) {
......
1 -import { gql } from "apollo-boost"; 1 +import gql from "graphql-tag";
2 2
3 export const GET_CATEGORIRES = gql` 3 export const GET_CATEGORIRES = gql`
4 { 4 {
......
1 -import { gql } from "apollo-boost"; 1 +import gql from "graphql-tag";
2 2
3 export const SUBSCRIPTION_MSG = gql` 3 export const SUBSCRIPTION_MSG = gql`
4 subscription { 4 subscription {
......
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`
......
1 -import { gql } from "apollo-boost"; 1 +import gql from "graphql-tag";
2 2
3 export const GET_ROOMS = gql` 3 export const GET_ROOMS = gql`
4 { 4 {
......