Giveth / DeVouch-BE

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

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

Closed divine-comedian closed 5 months ago

divine-comedian commented 7 months ago

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

For Flags

aminlatifi commented 6 months ago

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"
          }
        }
      }
    ]
  }
}
divine-comedian commented 6 months ago

@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

aminlatifi commented 6 months ago

Referen

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

maryjaf commented 5 months ago

I had tested this issue and moved it to done.