graphql-compose-mongoose
Version:
Plugin for `graphql-compose` which derive a graphql types from a mongoose model.
25 lines (19 loc) • 594 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PostModel = exports.PostSchema = void 0;
var _mongooseCommon = require("./mongooseCommon");
const PostSchema = new _mongooseCommon.Schema({
_id: {
type: Number
},
title: {
type: String,
description: 'Post title'
} // createdAt, created via option `timastamp: true` (see bottom)
// updatedAt, created via option `timastamp: true` (see bottom)
});
exports.PostSchema = PostSchema;
const PostModel = _mongooseCommon.mongoose.model('Post', PostSchema);
exports.PostModel = PostModel;