mirror of
https://github.com/wassname/talk.git
synced 2026-06-28 23:26:48 +08:00
16 lines
416 B
JavaScript
16 lines
416 B
JavaScript
const tools = require('graphql-tools');
|
|
const maskErrors = require('graphql-errors').maskErrors;
|
|
|
|
const resolvers = require('./resolvers');
|
|
const typeDefs = require('./typeDefs');
|
|
|
|
const schema = tools.makeExecutableSchema({typeDefs, resolvers});
|
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
|
|
// Mask errors that are thrown if we are in a production environment.
|
|
maskErrors(schema);
|
|
}
|
|
|
|
module.exports = schema;
|