Skip to content

fix: Family notes API-first refactor + params async#538

Merged
pmilano1 merged 7 commits into
mainfrom
fix/graphql-client-endpoint
Feb 14, 2026
Merged

fix: Family notes API-first refactor + params async#538
pmilano1 merged 7 commits into
mainfrom
fix/graphql-client-endpoint

Conversation

@pmilano1

@pmilano1 pmilano1 commented Feb 14, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the family notes 404 error and refactors to follow the API-first architecture.

Root Cause

  1. Page component wasn't awaiting params Promise (Next.js 15)
  2. Family notes used REST API routes instead of GraphQL (violated API-first pattern)

Changes

Fixed Page Bug

  • Made page component async and await params before passing to client

API-First Refactor

  • Deleted /api/family-notes/ REST routes
  • Deleted lib/graphql/client.ts (server-side HTTP client)
  • Created GraphQL queries in lib/graphql/queries/family-notes.ts
  • Updated components to use Apollo Client directly

Architecture

All client code now goes through /api/graphql using Apollo Client:

  • FamilyNotesClient → Apollo useQuery with GET_FAMILY_RESEARCH_NOTES
  • FamilyNoteViewerClient → Apollo useQuery + useMutation

No server-side API routes making HTTP calls to other server-side routes.

Fixes the 404 and aligns with API-first design.

🤖 Generated with Claude Code

- Delete REST API routes (/api/family-notes)
- Delete server-side GraphQL client (lib/graphql/client.ts)
- Convert components to use Apollo Client directly
- Add family-notes GraphQL queries and mutations
- All data flows through /api/graphql endpoint

This aligns with the API-first architecture where client code uses
Apollo Client to query GraphQL directly, not REST wrappers.
@pmilano1 pmilano1 changed the title fix: Await params Promise in family notes page fix: Family notes API-first refactor + params async Feb 14, 2026
@pmilano1 pmilano1 merged commit 1d7085f into main Feb 14, 2026
10 checks passed
pmilano1 pushed a commit that referenced this pull request Feb 14, 2026
## [1.126.13](v1.126.12...v1.126.13) (2026-02-14)

### Bug Fixes

* Family notes API-first refactor + params async ([#538](#538)) ([1d7085f](1d7085f))
@pmilano1

Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 1.126.13 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pmilano1 pmilano1 deleted the fix/graphql-client-endpoint branch February 21, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant