[catalog/query][xs]: fixed OrgInfo component of dataset page to re-use get dataset query as it doesn't need full org information.

Updated get dataset query to follow frictionless spec.
This commit is contained in:
anuveyatsu
2021-08-14 23:22:17 +06:00
parent 18dece1c04
commit 12df6dba3b
2 changed files with 7 additions and 7 deletions

View File

@@ -1,10 +1,10 @@
import { useQuery } from '@apollo/react-hooks'; import { useQuery } from '@apollo/react-hooks';
import { ErrorMessage } from '../_shared'; import { ErrorMessage } from '../_shared';
import { GET_ORG_QUERY } from '../../graphql/queries'; import { GET_DATASET_QUERY } from '../../graphql/queries';
import { Org } from 'portal'; import { Org } from 'portal';
const OrgInfo: React.FC<{ variables: any }> = ({ variables }) => { const OrgInfo: React.FC<{ variables: any }> = ({ variables }) => {
const { loading, error, data } = useQuery(GET_ORG_QUERY, { const { loading, error, data } = useQuery(GET_DATASET_QUERY, {
variables, variables,
// Setting this value to true will make the component rerender when // Setting this value to true will make the component rerender when
// the "networkStatus" changes, so we are able to know if it is fetching // the "networkStatus" changes, so we are able to know if it is fetching

View File

@@ -67,7 +67,7 @@ export const SEARCH_QUERY = gql`
results { results {
name name
title title
metadata_modified updated: metadata_modified
organization { organization {
name name
title title
@@ -138,19 +138,19 @@ export const GET_DATASET_QUERY = gql`
name name
title title
size size
metadata_created created: metadata_created
metadata_modified updated: metadata_modified
resources { resources {
name name
title title
format format
created created
last_modified updated: last_modified
} }
organization { organization {
name name
title title
image_url image: image_url
} }
} }
} }