-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(interface): use ES6 exports
- Loading branch information
Peter Marton
committed
Jul 30, 2015
1 parent
d7bb657
commit 7b5ea46
Showing
1 changed file
with
25 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}; |