-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when filtering for specific attester organization sort most vouches by filtered orgs #118
Comments
Cherik is implementing for 1 organization, maybe he can fix it for multiple organizations, needs more investigation |
@mateodaza @divine-comedian The BE is ready for it: query MyQuery($limit: Float = 10, $offset: Float = 0, $orgIds: [String!] = "", $sortBy: String = "") {
getProjectsSortedByVouchOrFlag(orgIds: $orgIds, sortBy: $sortBy, limit: $limit, offset: $offset) {
id
}
} and these are the variables: {
"offset": 0,
"limit": 100,
"sortBy": "totalVouches_DESC",
"orgIds": ["0xf63f2a7159ee674aa6fce42196a8bb0605eafcf20c19e91a7eafba8d39fa0404"]
} unfortunately, we only return the projects' Ids here and you have to send another request to fetch the projects' data with attestations and organization. let me know if you have any question. |
@MohammadPCh this worked perfectly, thanks for that - I'm leaving a draft PR here while I solve a question I got while integrating... Can we add also a way to filter by sources like the regular query? I believe this is needed to keep previous functionality untouched PS: also not sure if worth giving a try but, maaybe we can bring all the projects as well instead of only the id by doing a connection type of query, maybe it'd help to keep it lighter and not do double requests on the frontend |
@mateodaza Thanks! You’re absolutely right; we needed to handle the source in the query. Here’s the updated version: query MyQuery($sortBy: String, $sources: [String!], $organizations: [String!], $limit: Int, $offset: Int) {
getProjectsSortedByVouchOrFlag(limit: $limit, offset: $offset, organizations: $organizations, sortBy: $sortBy, sources: $sources) {
id
}
} {
"limit": 10,
"offset": 0,
"sortBy": "totalVouches_DESC",
"sources": ["giveth"],
"organizations": ["0xf63f2a7159ee674aa6fce42196a8bb0605eafcf20c19e91a7eafba8d39fa0404"]
} As for using connections, I gave it a try, but it’s challenging to integrate with Subsquid—or maybe I’m not fully sure how to handle it yet. Let’s stick with this approach for now, and we can look into improving it in the future. |
maybe @aminlatifi or @jainkrati can help you if you need some technical expertise Also there is the subsquid documentation, is this article relevant? |
@LatifatAbdullahi I've added in additional context and AC to help you with QA - it should be ready for you to test. |
Test Update
Filtering from specified source platforms with single or multiple Orgs still fetches Projects from other sources if its attested by the selected Orgs. For example, I filtered by RF Round 5 and Honorary Mexican, expecting Only Projects from the source platforms(RF Round 5) with attestations form Honorary Mexican(with other attestations if available), but I can see Projects from another unselected Source platform(Giveth) because it also has attestations from (Honorary mexican) |
Tagging @MohammadPCh |
@LatifatAbdullahi @mateodaza Thanks Guys. {
"organizations": [
"0xc80d5c0209976a6c994aa6dc3680f4ad2de2dbc1aa9f46164c251ad9e5e10e09"
],
"sortBy": "totalVouches_DESC",
"limit": 20,
"offset": 0
} so as you can see there is no |
@MohammadPCh sorry for not been so clear, the issue is that I can send rf by itself but it won't filter by specific round For now I'll just leave it working so it shows any round if a voucher is selected in the filter |
@mateodaza Thanks for clarifying! I fixed this issue on staging a few days ago, so you should be able to send |
nice yes! thanks a lot @MohammadPCh |
@MohammadPCh although I found a bug It excludes non rf sources if I send that array, can you double check that query? |
testing this out it on staging it seems when I filter by specific RF round and for specific attester org the returned results are from ALL RF rounds, it does not correctly filter for the specific RF round, however it does correctly filter for non RF source platforms (only Giveth or only Gitcoin) with a specified attester org VideoCompressorResizeCompressVideo2024_11_13_09_33_51.mp4Is there something else I'm missing? Looks like it's changed a bit from the testing @LatifatAbdullahi did earlier |
@divine-comedian Yes, something seems to have broken, @mateodaza confirmed yesterday that its still being worked and will let me know when to retest. |
@divine-comedian @LatifatAbdullahi, the API is working fine. I'll add the source and rfRounds fields to the returning fields so you can test it more easily. |
@MohammadPCh Thanks, please let me know when its ready to be retested, as it seems it still doesnt filter correctly for specific RF rounds |
Test Update
Filtering specific single/multiple Source platforms still returns data from other source platforms, this bug still applies to only RF Source platform, filtering for single or multiple RF Projects still returns data from other unselected RF source projects as because the unselected RF project contains the selected Attester Org. DeVouch._.Decentralized.Vouching.for.the.Projects.you.Trust.-.Google.Chrome.2024-11-18.10-34-55.mp4 |
@LatifatAbdullahi Thanks for reporting this problem query MyQuery($limit: Int = 10, $offset: Int = 10, $organizations: [String!] = "", $rfRounds: [Int!] = 10, $sortBy: String = "", $sources: [String!] = "") {
getProjectsSortedByVouchOrFlag(limit: $limit, offset: $offset, rfRounds: $rfRounds, sortBy: $sortBy, sources: $sources, organizations: $organizations) {
id
rfRounds
source
}
} and this is the variables: {
"organizations": [
"0x9224f06bd11d0076dbcb28e4f0c654d78cb071930653510360a3a00518ad1710","0xf63f2a7159ee674aa6fce42196a8bb0605eafcf20c19e91a7eafba8d39fa0404"
],
"sources": ["rf"],
"rfRounds": [5],
"sortBy": "totalVouches_DESC",
"limit": 20,
"offset": 0
} |
First example: Using the https://backend.devouch.xyz/graphql ; seems to return the expected results alone Filtering with same data on Staging FE; seems to return extra wrong results Second example: Using the https://backend.devouch.xyz/graphql ; seems to return the expected results alone Filtering with same data on Staging FE; seems to return extra wrong results Filtering on the BE https://backend.devouch.xyz/graphql seems to be returning the right data unlike the staging FE |
Test Update Thanks @mateodaza @MohammadPCh @divine-comedian The issue is now fixed
|
when we are sorting and filtering by an attester org we should sort by most vouches for the org that is being filtered for, same if we are filtering for multiple orgs we should use the most vouches across the total of the orgs being filtered for.
@MohammadPCh needs to provide query snipper for @mateodaza to use in the front-end
FOR EXAMPLE
FILTER FOR SINGLE ORG
consider this view, we filtered project by if they have received attestations from RF 5 or 6 voters..
currently the projects with the most total vouches from all orgs are shown on top.
The top project shown has 2 vouches from RF 5 or 6 voters, while some projects further below have 3 or more vouches from this group. We should show instead the projects that have the most vouches from the specified filtered org FIRST then descending downwards.
FILTER FOR MULTIPLE ORGS
In addition if we filtered for multiple orgs, such as RF 5/6 voters AND Giveth Verifiers we should consider the sum of vouches/flags (depending on the sort chosen) to decide the ordering of projects.
Consider this
Since we are filtering for RF 5/6 Voters and Giveth Verifiers we don't consider the Gitcoin Passport Holders when ordering the projects in the list. According to the example above the projects should be down in order from highest to lowest as:
AC
The text was updated successfully, but these errors were encountered: