Skip to content

Conversation

ludvigz
Copy link
Member

@ludvigz ludvigz commented Nov 13, 2026 •

Purpose

The GraphQL schema defines Query.build(id: ID!): Build, but no resolver was implemented, so requesting a single published build by ID always returned null. This PR adds the missing resolver.

Changes

  • Add the build(id) resolver in backend/server/src/resolvers.ts and register it under Query.
  • Validate the ID
  • Fetch the build with a parameterized query, returns null if it doesent exist.
  • Add resolver tests in backend/server/src/test/resolvers.test.ts.
  • Add test tooling to the server package.
  • Limit tsconfig.json to src and exclude src/test so tests aren't compiled into dist.

Related issues

Closes #95

Verification

Automated checks, run from backend/server:

  • npm test: 10 tests pass. They cover successful retrieval with a parameterized query, a nonexistent ID returning null, rejection of invalid IDs without querying the database, and Build.parts.

Manual testing:

Ran against the database, see screenshot

Screenshots

image

Checklist

  • I have reviewed my own changes.
  • The changes meet the linked issue's acceptance criteria, where applicable.
  • I have verified the changes and recorded the results above.
  • I have added or updated tests where needed.
  • I have updated documentation where needed.
  • I have included screenshots for visual changes, or marked them not applicable.

- Implemented a new GraphQL query resolver for fetching builds by ID with validation.
- Added unit tests for the build resolver, covering valid and invalid ID scenarios.
- Updated package.json to include vitest for testing.
- Created a vitest configuration file for test execution.
- Adjusted tsconfig.json to include source files and exclude test files.
@ludvigz ludvigz self-assigned this Nov 13, 2026
@ludvigz ludvigz requested a review from a team as a code owner November 13, 2026 14:39
Copy link
Member

@wilhelsr wilhelsr left a comment

Choose a reason for hiding this comment

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

LGTM! The resolver is well implemented, and the tests cover the key scenarios. Thanks for the fix! Approved

@wilhelsr wilhelsr merged commit 34f7114 into dev Nov 13, 2026
@wilhelsr wilhelsr deleted the 95-implement-missing-graphql-build-resolver branch November 13, 2026 17:10
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants