Skip to content
This repository has been archived by the owner on Apr 21, 2018. It is now read-only.

Generate collection specific query arguments #3

Closed
bsouthga opened this issue Dec 20, 2016 · 1 comment
Closed

Generate collection specific query arguments #3

bsouthga opened this issue Dec 20, 2016 · 1 comment

Comments

@bsouthga
Copy link
Contributor

Currently, the arguments for methods like findAll are untyped, we could generate fully typed schema for the arguments of these methods. This would allow typechecking mongo query objects:

const user = Tyr.byName.user.findAll({
  query: {
     _id: userId, // <- this is fine, as there is an _id property on User,
     mame: 'ben' // <- this causes compiler error, as property 'mame' doesn't exist on user.
   }
});
@bsouthga
Copy link
Contributor Author

closing as not currently possible until something like this gets in: microsoft/TypeScript#12424

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant