[recent datasets][xs]: only need first 3 datasets.

This commit is contained in:
anuveyatsu
2020-06-24 13:02:33 +06:00
parent 19f1d4b408
commit 5e62325c91
3 changed files with 9 additions and 5 deletions

View File

@@ -4,8 +4,8 @@ import { useQuery } from '@apollo/react-hooks';
import gql from 'graphql-tag';
export const QUERY = gql`
query search($q: String, $sort: String) {
search(q: $q, sort: $sort)
query search($q: String, $sort: String, $rows: Int) {
search(q: $q, sort: $sort, rows: $rows)
@rest(type: "Search", path: "package_search?{args}") {
result {
results {
@@ -24,7 +24,10 @@ export const QUERY = gql`
function Recent() {
const { loading, error, data } = useQuery(QUERY, {
variables: { sort: 'metadata_created desc' },
variables: {
sort: 'metadata_created desc',
rows: 3,
},
// 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