mirror of
https://github.com/wassname/talk.git
synced 2026-08-17 11:27:52 +08:00
Added joi plugin validation
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
// this change is done now everything will likely break on the front end.
|
||||
|
||||
const fs = require('fs');
|
||||
const Joi = require('joi');
|
||||
const path = require('path');
|
||||
const {mergeStrings} = require('gql-merge');
|
||||
const debug = require('debug')('talk:graph:typeDefs');
|
||||
@@ -20,6 +21,8 @@ const typeDefs = mergeStrings([
|
||||
|
||||
// Load the plugin definitions from the manager.
|
||||
...plugins.get('server', 'typeDefs').map(({plugin, typeDefs}) => {
|
||||
Joi.assert(typeDefs, Joi.string(), `Plugin '${plugin.name}' had an error loading the typeDefs`);
|
||||
|
||||
debug(`added plugin '${plugin.name}'`);
|
||||
|
||||
return typeDefs;
|
||||
|
||||
Reference in New Issue
Block a user