-
Notifications
You must be signed in to change notification settings - Fork 0
feat: basic Apollo Server (GraphQL) setup #23
Conversation
There was a problem hiding this 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.
|
We can add it as a prestart script, although that won't update the types as long as the server is running. |
|
We can also consider moving this to a git hook. I will research that option. |
|
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 |
|
Note to self: Update base branch to main before deleting the old base branch |
Very cool, I'll take a look! |
I think if you switched to using stacked PR's (ref my earlier comment) this isn't a problem |
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
mainafter that PR is merged.This PR should be merged after #22.