Skip to content

[Issue]: Nonprofit Sorting by A to Z and vice versa, Most Recent, and Status #62

@soramicha

Description

@soramicha

Branch Name

feature/62-sorting-nonprofit

Task

The goal is to edit the GraphQL endpoint for nonprofits to allow sorting. We will sort nonprofits by status, A to Z, and Most Recent. Those three can also be used at the same time together, etc.

Why GraphQL and not REST? REST is awesome for simple querying commands while GraphQL is a lot more flexible. In fact, it is recommended and better practice to use GraphQL when it comes to filtering, sorting, and pagination, etc. Remember that using GraphQL means we can also control exactly what information we want to be returned to us, which is convenient. And this is all using just one endpoint too 💃

Inputs: (note they are all optional! and users can input one or more options! check Figma link I sent in the Slack for the visual idea of what this functionality is gonna do)
Status - refers to current state (check nonprofit_chapter_project, and if the nonprofit is still ongoing when the end_date is not fulfilled yet, then the status is ACTIVE, otherwise it's inactive) (there is only ACTIVE and INACTIVE as status options)
Most Recent - use nonprofit_chapter_project to find the start_date of those nonprofits involved to sort
A to Z and vice versa - use the names in the nonprofits table for sorting ASC and DESC

The plan is that in the frontend, the user will pick 1+ chapters and 1+ status and they will be all string inputs in our GraphQL. And then within our resolvers, we will convert the strings into IDs and do whatever JOIN commands necessary. Refer to https://docs.google.com/document/d/1tE_8BkrLbqR_SMnS2NA_ro1-d_y7V1rx-6VexejoN38/edit?tab=t.0 highlighted in green to get an idea of how you can get the proper data we need!

Test using Postman, and make sure to screenshot your results when you make your PR!

Image from Figma for this:

Acceptance Criteria

  • A to Z and Z to A sorting
  • Most Recent Sorting
  • Status Sorting
  • Compatible sorting with one or more those sorting options

Checklist

  • I have checked for duplicate issues.
  • I have assigned the issue to the correct project board.
  • I have tagged the issue properly.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions