Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@samselikoff we had a conversation about this a little over a month ago, and I went and implemented it but then never actually committed the files and opened a pull request 🤦
This PR introduces a
createServer
function as an alternative to writingnew Server
. While it doesn't add any new functionality, it does have a couple of advantages:In other words, if I write
schema.all('foo')
in a route handler, TypeScript can tell based on thefoo
model/factory I provide what type the result will have. Or, if I haven't provided afoo
model, it can correctly flagschema.all('foo')
as an error./cc @zoltan-nz @chriskrycho