Mongease plugin for adding support to GraphQL schemas creation.
$ npm install --save mongease-graphql
import Mongease from 'mongease';
import MongeaseGraphQL from 'mongease-graphql';
Mongease.plugin ( MongeaseGraphQL.make );
Mongease.make ( 'Book', {
schema: {
title: String,
category: Number,
read: Boolean
},
resolvers: {
Query: {
findBooks () {}
},
Mutation: {
bookMarkAsRead () {}
}
}
});
const schema = MongeaseGraphQL.getSchema ();
Returns the GraphQL schema as a string.
Returns all the parsed resolvers, grouped by type.
Returns the compiled GraphQL schema.
Function that should be passed to Mongease.plugin
, enables auto creation of types, parsing of resolvers, and creation of schemas.
- mongoose-to-graphql - Converts a Mongoose schema to its GraphQL representation.
- mongease - Tiny wrapper around Mongoose for easier creation of schemas and models. Supports plugins.
- mongease-graphql-builder - Module for auto-generating simple GraphQL queries from Mongease descriptions.
MIT © Fabio Spampinato