Converts a Mongoose schema to its GraphQL representation.
$ npm install --save mongoose-to-graphql
import MongooseToGraphql from 'mongoose-to-graphql';
MongooseToGraphql.type ({
type: [String],
required: true
}); // [String]!
MongooseToGraphql ( 'Book', {
title: String,
category: Number
}); // type Book {
// title: String
// category: Float
// }
Calls .schema
with ...args
.
Converts an object or a Mongoose schema to its GraphQL string representation.
Converts a Mongoose model to its GraphQL string representation.
Converts a plain object to its GraphQL string representation.
Converts a supported type to its GraphQL string representation, or throws an error.
- mongease - Tiny wrapper around Mongoose for easier creation of schemas and models. Supports plugins.
- mongease-graphql - Mongease plugin for adding support to GraphQL schemas creation.
- mongease-graphql-builder - Module for auto-generating simple GraphQL queries from Mongease descriptions.
MIT © Fabio Spampinato