diff --git a/src/containers/home/index.tsx b/src/containers/home/index.tsx index 2db5824..7f56d7a 100644 --- a/src/containers/home/index.tsx +++ b/src/containers/home/index.tsx @@ -1,23 +1,14 @@ import React, { FC } from 'react'; -import { gql, useQuery } from '@apollo/client'; import TodoList from './TodoList'; import { Button } from '../../components/button'; import { Container } from '../../components/container'; -const LIST_TODOS = gql` - query ListAll { - listTodos { - todoId - title - isDone - } - } -`; +import { useListTodos } from '../../core/services/todo'; export const Home: FC = () => { - // const todos: Todo[] = listTodos(); - const { loading, error, data } = useQuery(LIST_TODOS); + const { loading, error, data } = useListTodos(); + if (error) { return
Sorry...
; } @@ -26,7 +17,7 @@ export const Home: FC = () => {Hi there!
- {!loading &&