Giveth/DeVouch-BE

[needs project data] Filter by vouches/flags made by user address

Closed this issue · 4 comments

Filter the response to ONLY show Vouches made by address

OR

Filter the response to ONLY show Flags made by address

https://backend.devouch.xyz/graphql

AC

we should be able to query the endpoint above, for a specific user address, filtered by only vouches or flags, the response should be able to include:

For Vouches

  • all vouches made by a user
  • does not include flags made by user
  • pagination works to see all vouches (skip, take, limit etc..)
  • title of project
  • source platform (giveth, gitcoin, rpgf)
  • link/slug to project details
  • attester group attestation was done as
  • if it was a vouch
  • comment included in attestation (if applicable)
  • date of attestations

For Flags

  • all flags made by a user
  • does not include vouches made by user
  • pagination works to see all vouches (skip, take, limit etc..)
  • title of project
  • source platform (giveth, gitcoin, rpgf)
  • link/slug to project details
  • attester group attestation was done as
  • if it was a flag
  • comment included in attestation (if applicable)
  • date of attestations

Sample query

{
  projectAttestations(where: {attestorOrganisation: {attestor: {id_eq: "0x826976d7c600d45fb8287ca1d7c76fc8eb732030"}}}) {
    project {
      id
    }
    attestorOrganisation {
      attestor {
        id
      }
    }
  }
}

Response

{
  "data": {
    "projectAttestations": [
      {
        "project": {
          "id": "giveth-2880"
        },
        "attestorOrganisation": {
          "attestor": {
            "id": "0x826976d7c600d45fb8287ca1d7c76fc8eb732030"
          }
        }
      },
      {
        "project": {
          "id": "giveth-2880"
        },
        "attestorOrganisation": {
          "attestor": {
            "id": "0x826976d7c600d45fb8287ca1d7c76fc8eb732030"
          }
        }
      },
      {
        "project": {
          "id": "giveth-2881"
        },
        "attestorOrganisation": {
          "attestor": {
            "id": "0x826976d7c600d45fb8287ca1d7c76fc8eb732030"
          }
        }
      }
    ]
  }
}

@aminlatifi are there any limitations to the amount of data it returns in the response? Did we consider imposing any limits in the response and use pagination, assuming a user or any entity really could have 100s of objects in its response.

We'll also need the project title included in the response so we can't test this one yet

Referen

There is built-in pagination support with limit and skip parameters. Also, subsquid has a more advanced alternative with cursor support.

I had tested this issue and moved it to done.