diff --git a/components/dataset/About.tsx b/components/dataset/About.tsx index 1cb63447..188aba21 100644 --- a/components/dataset/About.tsx +++ b/components/dataset/About.tsx @@ -1,5 +1,4 @@ import ErrorMessage from '../Error'; -import { NetworkStatus } from 'apollo-client'; import { useQuery } from '@apollo/react-hooks'; import gql from 'graphql-tag'; @@ -21,16 +20,13 @@ export const GET_DATAPACKAGE_QUERY = gql` `; export default function About({ variables }) { - const { loading, error, data, fetchMore, networkStatus } = useQuery( - GET_DATAPACKAGE_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 - // more data - notifyOnNetworkStatusChange: true, - } - ); + const { loading, error, data } = useQuery(GET_DATAPACKAGE_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 + // more data + notifyOnNetworkStatusChange: true, + }); if (error) return ; if (loading) return
Loading
; diff --git a/components/dataset/Org.tsx b/components/dataset/Org.tsx index 00b7fd9f..2cd90b64 100644 --- a/components/dataset/Org.tsx +++ b/components/dataset/Org.tsx @@ -1,6 +1,5 @@ import Link from 'next/link'; import ErrorMessage from '../Error'; -import { NetworkStatus } from 'apollo-client'; import { useQuery } from '@apollo/react-hooks'; import gql from 'graphql-tag'; @@ -19,16 +18,13 @@ export const GET_ORG_QUERY = gql` `; export default function Org({ variables }) { - const { loading, error, data, fetchMore, networkStatus } = useQuery( - GET_ORG_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 - // more data - notifyOnNetworkStatusChange: true, - } - ); + const { loading, error, data } = useQuery(GET_ORG_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 + // more data + notifyOnNetworkStatusChange: true, + }); if (error) return ; if (loading) return
Loading
; diff --git a/components/dataset/Resources.tsx b/components/dataset/Resources.tsx index 1105a47c..2ed6425f 100644 --- a/components/dataset/Resources.tsx +++ b/components/dataset/Resources.tsx @@ -1,6 +1,5 @@ import Link from 'next/link'; import ErrorMessage from '../Error'; -import { NetworkStatus } from 'apollo-client'; import { useQuery } from '@apollo/react-hooks'; import gql from 'graphql-tag'; @@ -22,16 +21,13 @@ export const GET_DATAPACKAGE_QUERY = gql` `; export default function Resources({ variables }) { - const { loading, error, data, fetchMore, networkStatus } = useQuery( - GET_DATAPACKAGE_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 - // more data - notifyOnNetworkStatusChange: true, - } - ); + const { loading, error, data } = useQuery(GET_DATAPACKAGE_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 + // more data + notifyOnNetworkStatusChange: true, + }); if (error) return ; if (loading) return
Loading
; diff --git a/components/resource/About.tsx b/components/resource/About.tsx index 7caa9765..04a2827e 100644 --- a/components/resource/About.tsx +++ b/components/resource/About.tsx @@ -1,6 +1,5 @@ import Link from 'next/link'; import ErrorMessage from '../Error'; -import { NetworkStatus } from 'apollo-client'; import { useQuery } from '@apollo/react-hooks'; import gql from 'graphql-tag'; diff --git a/components/resource/DataExplorer.tsx b/components/resource/DataExplorer.tsx index 5fdf4363..c35e117e 100644 --- a/components/resource/DataExplorer.tsx +++ b/components/resource/DataExplorer.tsx @@ -1,6 +1,5 @@ import Link from 'next/link'; import ErrorMessage from '../Error'; -import { NetworkStatus } from 'apollo-client'; import { useQuery } from '@apollo/react-hooks'; import gql from 'graphql-tag'; diff --git a/components/search/List.tsx b/components/search/List.tsx index c8946722..2d7127da 100644 --- a/components/search/List.tsx +++ b/components/search/List.tsx @@ -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 diff --git a/components/search/Total.tsx b/components/search/Total.tsx index 0a77a25a..dfd88609 100644 --- a/components/search/Total.tsx +++ b/components/search/Total.tsx @@ -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 ; if (loading) return
Loading
; const { result } = data.search;