Skip to content

Conversation

robertky
Copy link
Member

What this does

Defines the M1 data model and GraphQL contract for Crate.

  • Adds schema.graphql for albums, artists, tracks, genres, reviews, crate and search.
  • Adds docs/data-model.md to explain the key relationships and choices.
  • Plans search, sorting, genre filtering, cursor paging, reviews and the personal crate.

Intentionally out of scope

PostgreSQL, the GraphQL server and resolvers belong to M2 in #5 and #6. This PR defines the contract those tasks will implement.

What was checked

  • git diff --check
  • Read through the SDL and model documentation for consistency.

After #32 lands, I will update this branch with main and run the shared pnpm quality checks before merge.

Closes #2

@robertky robertky requested a review from a team as a code owner September 28, 2026 10:33
Copy link
Member

@evenkkl evenkkl left a comment

Choose a reason for hiding this comment

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

schema.graphql, line 15 (Album)
There's no way to fetch the current user's own review, so we can't prefill the form. Could we add myReview: Review?

schema.graphql, line 10 (upsertReview)
Could the review and crate mutations also return album: Album!? Otherwise the rating, review count and isInCrate go stale in the cache.

schema.graphql, line 12 (toggleCrate)
A toggle can end up wrong on a double click or retry. Maybe addToCrate/removeFromCrate instead?

Overall
Looks good, clean schema! The three comments above are my only real concerns. Small things for later: a rating range (1-5?), a max for first, and descriptions on the fields.

@rachelks rachelks self-requested a review September 30, 2026 11:44
Copy link
Member

@rachelks rachelks 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 now!

@rachelks rachelks merged commit 7d910ec into main Sep 30, 2026
2 checks passed
@rachelks rachelks deleted the feat/2-graphql-sdl branch October 15, 2026 08:30
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Choose the data model and write the GraphQL SDL
3 participants