Giveth / DeVouch-BE

DeVouch - Decentralized Vouching via Attestations
GNU General Public License v3.0
22 stars 2 forks source link

sorting data responses by date of attestation #21

Closed divine-comedian closed 3 months ago

divine-comedian commented 5 months ago

When fetching attestations related to a single project we should be able to sort the responses according to the date the attestation was created in both ascending and descending order.

AC

attestation data contains:

aminlatifi commented 4 months ago

Sample query

{
  projectAttestations(orderBy: attestTimestamp_DESC, where: {project: {id_eq: "giveth-2881"}}) {
    attestTimestamp
    vouch
    project {
      id
    }
  }
}

Response

{
  "data": {
    "projectAttestations": [
      {
        "attestTimestamp": "2024-05-13T09:21:24.000000Z",
        "vouch": false,
        "project": {
          "id": "giveth-2881"
        }
      },
      {
        "attestTimestamp": "2024-05-12T16:26:36.000000Z",
        "vouch": true,
        "project": {
          "id": "giveth-2881"
        }
      }
    ]
  }
}
maryjaf commented 4 months ago

The tests have been passed