From b11f2a4f193461ea86ec6e2b728f7a73d44c0c5d Mon Sep 17 00:00:00 2001 From: Barry Gitarts Date: Mon, 28 Oct 2019 13:23:28 -0400 Subject: [PATCH] pass in order direction --- src/components/projects/ListProjects.jsx | 3 ++- src/components/projects/queries.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/projects/ListProjects.jsx b/src/components/projects/ListProjects.jsx index 27403cf..fbf4c8f 100644 --- a/src/components/projects/ListProjects.jsx +++ b/src/components/projects/ListProjects.jsx @@ -133,7 +133,8 @@ function ListProjects() { { variables: { offset, - limit: 5 + limit: 5, + orderDirection: 'desc' } } ) diff --git a/src/components/projects/queries.js b/src/components/projects/queries.js index a2caaee..fcd2fca 100644 --- a/src/components/projects/queries.js +++ b/src/components/projects/queries.js @@ -104,8 +104,8 @@ query Profile($id: ID!) { export const getProjects = gql` ${pledgesInfosFields} -query Projects($type: String! = "PROJECT", $limit: Int, $offset: Int){ - profiles(where: {type: $type, projectInfo_not: null}, first: $limit, skip: $offset, orderBy: profileId, orderDirection: desc) { +query Projects($type: String! = "PROJECT", $limit: Int, $offset: Int, $orderDirection: String){ + profiles(where: {type: $type, projectInfo_not: null}, first: $limit, skip: $offset, orderBy: profileId, orderDirection: $orderDirection) { id addr canceled