Skip to content
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

feat: Improve search #1

Open
wants to merge 7 commits into
base: wip-improve-search
Choose a base branch
from

Conversation

1a35e1
Copy link

@1a35e1 1a35e1 commented Nov 23, 2024

Howdy so I had a quick dive on the Gitcoin APIs they seem to have all the necessary endpoints to facilitate the discussion that was originally started here: https://t.me/c/1724749443/1/10504

One tool that is super helpful exploring GraphQL APIs is https://graphql-kit.com/graphql-voyager/

  • Copy the content from
    intospection.json
  • Paste the results of the introspection Change Schema -> Introspection -> Display

From here it seems:

  • For the project search query searchProjects(searchTerm: $searchTerm) seems to do the job we want.
  • We can minimise the number of calls and remove unnecessary filters, leaning on the API itself.
  • From this I added a ProjectContext so data is fetched only once in a requests lifecycle
  • We can lean on other apis such as query donations() to paginate data

TODO

  • Reimplement DonationsTable
  • rounds subpages
  • Autocomplete jank
  • Reimplement generateMetadata

@1a35e1 1a35e1 marked this pull request as draft November 23, 2024 15:53
@duckdegen duckdegen requested a review from johnshift December 11, 2024 03:44
@duckdegen
Copy link
Member

Hey @johnshift can you provide an estimate on when this will be merged, and if additional steps are necesssary?

@johnshift
Copy link
Contributor

Heya @1a35e1 @duckdegen. I’m tied up with other tasks at the moment but will take a look soon!

@johnshift
Copy link
Contributor

Hey @1a35e1, sorry for the delayed reply. Holidays kept things busy. Hope you had a great break!
Thanks for diving into the Gitcoin APIs. We really appreciate the effort! 🙌

It looks like the implementation revolves around the searchProjects(searchTerm: $searchTerm) query.
Just to share some context, we’re currently filtering projects by their application status to include only those with a status of "approved," which doesn’t seem to be supported here.

If you have ideas for adjusting the approach or leveraging another API endpoint to better align with this requirement, we’d love to hear them.

@MasterHW
Copy link

MasterHW commented Jan 8, 2025

Just to share some context, we’re currently filtering projects by their application status to include only those with a status of "approved," which doesn’t seem to be supported here.

hi John, correct there is no elegant way to filter application status on a project model query. this is a limitation because not all projects even have applications, so filtering on a field that may or may not exist is harder for us to structure.

a less elegant approach that may still work for you is to return the applications { status } field, and decide whether to display this on the page or not by whether it has an APPROVED application.
image

let me know if this is satisfactory or not.

@johnshift johnshift changed the base branch from dev to wip-improve-search January 10, 2025 07:01
@johnshift johnshift marked this pull request as ready for review January 10, 2025 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants