mirror of
https://github.com/strapi/strapi.git
synced 2025-07-30 04:20:34 +00:00

* Add basic implementation for the graphql extension service * Add createPolicyContext in @strapi/utils * policiesMiddleware implementation for graphql * wrapResolvers first implementation (authentication, middlewares, policies) * move the content API schema build from /generators to /content-api. Extract types' register functions into a dedicated folder * fix schema generation on bootstrap * update the graphql service file to match new services arch * fix single type queries * simplify entity's resolver * use apollo graphql conventions for resolver's args naming * use the graphql extension system in i18n to add a locale arg to localized queries & mutations
27 lines
576 B
JavaScript
27 lines
576 B
JavaScript
'use strict';
|
|
|
|
const createExtension = require('./extension');
|
|
const createExtensionRegistry = require('./extension-registry');
|
|
|
|
module.exports = context => {
|
|
const extensionRegistry = createExtensionRegistry(context);
|
|
|
|
return {
|
|
/**
|
|
* Returns an Extension instance based on the provided name
|
|
* @param name
|
|
* @param configuration
|
|
*/
|
|
for(name) {
|
|
if (!extensionRegistry.has(name)) {
|
|
extensionRegistry.add(name);
|
|
}
|
|
|
|
return extensionRegistry.get(name);
|
|
},
|
|
|
|
createExtension,
|
|
registry: extensionRegistry,
|
|
};
|
|
};
|