Skip to content

Commit

Permalink
refactor(interface): use ES6 exports
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Marton committed Jul 30, 2015
1 parent d7bb657 commit 7b5ea46
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
import {graphql} from 'graphql';

import {getModels} from './model';
import {getSchema} from './schema';
import {getTypes} from './type';
import schema from './schema';
import type from './type';

module.exports.getSchema = function (mongooseModels) {
/**
* Public interface for schemas
* @method getSchema
* @param {Array} mongooseModels
* @return {Object} GraphQL schema
*/
function getSchema (mongooseModels) {
var models = getModels(mongooseModels);
return getSchema(models);
};
return schema.getSchema(models);
}

module.exports.getTypes = function (mongooseModels) {
/**
* Public interface for types
* @method getTypes
* @param {Array} mongooseModels
* @return {Object} GraphQL types
*/
function getTypes (mongooseModels) {
var models = getModels(mongooseModels);
return getTypes(models);
};
return type.getTypes(models);
}

module.exports.graphql = graphql;
export {
graphql,
getSchema,
getTypes
};

0 comments on commit 7b5ea46

Please sign in to comment.