mirror of
https://github.com/wassname/talk.git
synced 2026-07-03 15:28:27 +08:00
Merge branch 'master' into bump-version-3-9-0
This commit is contained in:
+9
-1
@@ -1,3 +1,6 @@
|
||||
const debug = require('debug')('talk:graph:connectors');
|
||||
const merge = require('lodash/merge');
|
||||
|
||||
// Errors.
|
||||
const errors = require('../errors');
|
||||
|
||||
@@ -76,4 +79,9 @@ const connectors = {
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = connectors;
|
||||
module.exports = Plugins.get('server', 'connectors').reduce((defaultConnectors, {plugin, connectors: pluginConnectors}) => {
|
||||
debug(`adding plugin '${plugin.name}'`);
|
||||
|
||||
// Merge in the plugin connectors.
|
||||
return merge(defaultConnectors, pluginConnectors);
|
||||
}, connectors);
|
||||
|
||||
+12
-1
@@ -1,4 +1,8 @@
|
||||
const {makeExecutableSchema} = require('graphql-tools');
|
||||
const {
|
||||
makeExecutableSchema,
|
||||
addSchemaLevelResolveFunction,
|
||||
} = require('graphql-tools');
|
||||
const debug = require('debug')('talk:graph:schema');
|
||||
const {decorateWithHooks} = require('./hooks');
|
||||
const {decorateWithErrorHandler} = require('./errorHandler');
|
||||
|
||||
@@ -14,4 +18,11 @@ decorateWithHooks(schema, plugins.get('server', 'hooks'));
|
||||
// Handle errors like masking in production and mutation errors.
|
||||
decorateWithErrorHandler(schema);
|
||||
|
||||
// For each schemaLevelResolveFunction, add it to the schema.
|
||||
plugins.get('server', 'schemaLevelResolveFunction').forEach(({plugin, schemaLevelResolveFunction}) => {
|
||||
debug(`added schemaLevelResolveFunction from plugin '${plugin.name}'`);
|
||||
|
||||
addSchemaLevelResolveFunction(schema, schemaLevelResolveFunction);
|
||||
});
|
||||
|
||||
module.exports = schema;
|
||||
|
||||
Reference in New Issue
Block a user