Skip to content

fix: replace dead v1 curriculum REST API with GraphQL#584

Merged
NewtonLC merged 4 commits intofreeCodeCamp:mainfrom
raisedadead:fix/curriculum-db-graphql
Apr 21, 2026
Merged

fix: replace dead v1 curriculum REST API with GraphQL#584
NewtonLC merged 4 commits intofreeCodeCamp:mainfrom
raisedadead:fix/curriculum-db-graphql

Conversation

@raisedadead
Copy link
Copy Markdown
Member

@raisedadead raisedadead commented Mar 6, 2026

The v1 REST API at freecodecamp.org/curriculum-data/v1/ now returns 404 HTML, crashing every page that loads curriculum data. Replace with the GraphQL API at curriculum-db.freecodecamp.org.

  • Add util/curriculum/fetchCurriculum.js (GraphQL client with cache)
  • Rewire getAllSuperblockTitlesAndDashedNames to use GraphQL
  • Rewire getSuperblockTitlesInClassroomByIndex to use GraphQL
  • Update classes page and all 3 dashboard pages

  The v1 REST API at freecodecamp.org/curriculum-data/v1/ now returns
  404 HTML, crashing every page that loads curriculum data. Replace with
  the GraphQL API at curriculum-db.freecodecamp.org.

  - Add util/curriculum/fetchCurriculum.js (GraphQL client with cache)
  - Rewire getAllSuperblockTitlesAndDashedNames to use GraphQL
  - Rewire getSuperblockTitlesInClassroomByIndex to use GraphQL
  - Update classes page and all 3 dashboard pages
Comment thread util/curriculum/fetchCurriculum.js Outdated
Copy link
Copy Markdown
Contributor

@CarlyAThomas CarlyAThomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @raisedadead

This PR returns several things that should not be in the list that a teacher can select for a classroom:

  1. Legacy Certifications are included (responsive-web-design)
  2. Courses that are parts of other curriculum certifications (basic-html)
  3. Upcoming Courses (a2-professional-spanish)

To solve this we can either:

  • In classroom app, hardcode a list of certifications that should be excluded.
  • In the GraphQL API add flags for isLegacy, etc. fields to use for the filtering

Which solution do you prefer? Do you think it is doable to add these flags into the GraphQL API or should we have them hardcoded?

@utsab
Copy link
Copy Markdown
Collaborator

utsab commented Mar 27, 2026

@CarlyAThomas - Thanks for catching those cases of certifications that should not be shown in Classroom App. For now, let's go with your first recommended solution to simply hardcode the excluded certifications.

NewtonLC and others added 3 commits April 20, 2026 18:48
…ridge

- Replace fetchCurriculum.js (broken order field) with fetchSuperblocksFromGraphQL.js
- Remove order from GraphQL query; use blockIndex for ordering instead
- Add constants.js with LEGACY/INTERVIEW_PREP hardcoded filter sets (temporary
  until GraphQL adds isLegacy/isJobPrep fields to schema)
- Add CERT_REQUIREMENTS for v9 cert dependency expansion
- Change fccCertifications Prisma field from Int[] to String[] (dashed names)
- Update all pages/utils/components to use new GraphQL-based curriculum fetch
- Add graphqlCurriculumAdapters test for the new fetch utilities
- Rename initial migration timestamp to match refactor branch history

TODO: Remove hardcoded constants once GraphQL schema adds isLegacy/isJobPrep/requirements fields
@NewtonLC NewtonLC marked this pull request as ready for review April 21, 2026 02:11
@NewtonLC NewtonLC requested a review from a team as a code owner April 21, 2026 02:11
@NewtonLC NewtonLC dismissed stale reviews from CarlyAThomas and themself April 21, 2026 02:12

Putting this aside for now, but a TODO has been made

Copy link
Copy Markdown
Contributor

@NewtonLC NewtonLC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! We found no issues upon testing.

@NewtonLC NewtonLC merged commit f03129f into freeCodeCamp:main Apr 21, 2026
2 of 3 checks passed
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