Skip to content

Conversation

martakam
Copy link
Member

@martakam martakam commented Oct 3, 2026 •

This PR adds a very simple Apollo Server that will provide GraphQL support for us.
It also sets up GraphQL codegen, which gives us typescript types based on our schema defined in ./src/schema.
Any files including .generated. in their name can be completely ignored in the review.

Note: The base branch is the branch used in #22 in order to make it easier to read changes and it will be changed to main after that PR is merged.
This PR should be merged after #22.

@martakam martakam self-assigned this Oct 3, 2026
@martakam martakam added the enhancement New feature or request label Oct 3, 2026
@martakam martakam linked an issue Oct 3, 2026 that may be closed by this pull request
@martakam martakam added this to the Deliverable 2 milestone Oct 3, 2026
johahor
johahor previously approved these changes Oct 7, 2026
Copy link
Member

@johahor johahor left a comment

Choose a reason for hiding this comment

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

Tested locally: compile passes, the server starts and the books query returns the two sample books. Approving.

One suggestion: the generated files are committed, but they have to be regenerated manually. If someone forgets to run codegen after changing the schema, the types silently go out of date. Could we add a codegen script and run it automatically before start and dev, for example with a prestart script? I'm not thinking in this PR so we get things moving, but maybe create a new issue for this. Give me your thoughts, and I'll file a issue if you agree.

@martakam martakam marked this pull request as ready for review October 7, 2026 18:36
@martakam martakam requested a review from a team as a code owner October 7, 2026 18:36
@martakam
Copy link
Member Author

martakam commented Oct 7, 2026

We can add it as a prestart script, although that won't update the types as long as the server is running.
It is generally very difficult to make the types go out of date, as you will likely be editing code that uses those types.
Either way, adding it as a prestart script is a good idea!

@martakam
Copy link
Member Author

martakam commented Oct 7, 2026

We can also consider moving this to a git hook. I will research that option.

@johahor
Copy link
Member

johahor commented Oct 7, 2026 •

Btw, do you know that github have their own CLI for stacked PR's. They "recently" dropped it, and I think it's still in beta, but I'm using it (haven't yet in this project), and I think it's working pretty well.

Here's a link for it: https://docs.github.com/en/pull-requests/get-started/about-stacked-prs

@martakam martakam deleted the branch main October 7, 2026 18:45
@martakam martakam closed this Oct 7, 2026
@martakam martakam reopened this Oct 7, 2026
@martakam martakam changed the base branch from feat/basic-express-server to main October 7, 2026 18:49
@martakam martakam dismissed johahor’s stale review October 7, 2026 18:49

The base branch was changed.

@martakam
Copy link
Member Author

martakam commented Oct 7, 2026

Note to self: Update base branch to main before deleting the old base branch

@martakam
Copy link
Member Author

martakam commented Oct 7, 2026

Btw, do you know that github have their own CLI for stacked PR's. They "recently" dropped it, and I think it's still in beta, but I'm using it (haven't yet in this project), and I think it's working pretty well.

Here's a link for it: https://docs.github.com/en/pull-requests/get-started/about-stacked-prs

Very cool, I'll take a look!

@johahor
Copy link
Member

johahor commented Oct 7, 2026

Note to self: Update base branch to main before deleting the old base branch

I think if you switched to using stacked PR's (ref my earlier comment) this isn't a problem

@martakam martakam merged commit 7cfa262 into main Oct 7, 2026
Sign in to join this conversation on GitHub.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: add GraphQL to the project
2 participants