Skip to content

Migrate useBounties and useInfiniteBounties hooks to GraphQL #101

Description

@0xdevcollins

Depends on: #100

Migrate the paginated bounty list hooks from REST to GraphQL.

Files to modify

  • hooks/use-bounties.ts — use useBountiesQuery from generated hooks
  • hooks/use-infinite-bounties.ts — adapt to GraphQL's PaginatedBounties response shape (bounties[], total, limit, offset) instead of the current PaginatedResponse<Bounty> shape (data[], pagination)
  • hooks/use-bounty-search.ts — use the bounties query with search variable

Tasks

  • Replace bountiesApi.list(params) with the codegen useBountiesQuery({ query: params })
  • Map the PaginatedBounties response ({ bounties, total, limit, offset }) to what the UI expects
  • Update useInfiniteBounties to use useInfiniteQuery with the GraphQL bounties query, paginating via the page variable
  • Update useBountySearch to use the GraphQL bounties query with { search } filter
  • Verify the discover page and home page still render bounty lists correctly

Acceptance Criteria

  • Bounty list, infinite scroll, and search all use GraphQL
  • No REST calls remain for listing bounties

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions