[clean up][xs]: removed unnecessary imports.

This commit is contained in:
anuveyatsu
2020-06-24 14:59:54 +06:00
parent 5e62325c91
commit 0dbe145e8c
7 changed files with 24 additions and 37 deletions

View File

@@ -1,6 +1,5 @@
import Item from './Item';
import ErrorMessage from '../Error';
import { NetworkStatus } from 'apollo-client';
import { useQuery } from '@apollo/react-hooks';
import gql from 'graphql-tag';
@@ -23,7 +22,7 @@ const QUERY = gql`
`;
export default function List({ variables }) {
const { loading, error, data, fetchMore, networkStatus } = useQuery(QUERY, {
const { loading, error, data } = useQuery(QUERY, {
variables,
// Setting this value to true will make the component rerender when
// the "networkStatus" changes, so we are able to know if it is fetching

View File

@@ -1,3 +1,4 @@
import ErrorMessage from '../Error';
import { useQuery } from '@apollo/react-hooks';
import gql from 'graphql-tag';
@@ -21,6 +22,7 @@ export default function Total({ variables }) {
notifyOnNetworkStatusChange: true,
});
if (error) return <ErrorMessage message="Error loading search results." />;
if (loading) return <div>Loading</div>;
const { result } = data.search;