Astronomy is basically the missing model layer for Meteor. You can write your validations, schema, methods, timestamps, callbacks, and more all in a single place. Think: A Rails model for Meteor.
It’s pretty awesome!
Example:
import { Class } from 'meteor/jagi:astronomy';
const Posts = new Mongo.Collection('posts');
const Post = Class.create({
name: 'Post',
collection: Posts,
fields: {
title: {
type: String,
validators: [{
type: 'gte',
param: 3
}]
},
userId: String,
publishedAt: Date
},
behaviors: {
timestamp: {}
}
});
Would be cool to have this generate a GraphQL schema as well! Something to think about in the coming months, would make it super easy to get Apollo going.
I haven’t been playing with Apollo yet, but I will support it in the future. However, I think it’s gonna need to be a fork of Astronomy that would behave in a little bit different way. We will see as I start playing with Apollo.