Skip to content
This repository has been archived by the owner on Aug 10, 2019. It is now read-only.

Mongease plugin for adding support to GraphQL schemas creation.

License

Notifications You must be signed in to change notification settings

fabiospampinato/mongease-graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mongease GraphQL

Mongease plugin for adding support to GraphQL schemas creation.

Install

$ npm install --save mongease-graphql

Usage

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 ();

API

.getTypes (): string

Returns the GraphQL schema as a string.

.getResolvers (): {}

Returns all the parsed resolvers, grouped by type.

.getSchema (): GraphQLSchema

Returns the compiled GraphQL schema.

.make ( name: string, config: {} )

Function that should be passed to Mongease.plugin, enables auto creation of types, parsing of resolvers, and creation of schemas.

Related

  • 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.

License

MIT © Fabio Spampinato

About

Mongease plugin for adding support to GraphQL schemas creation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published