Jean-Sébastien Herbaux 357fd163b0
V4/graphql customization (#10850)
* 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
2021-09-01 12:06:51 +02:00

20 lines
444 B
JavaScript

'use strict';
const { omit } = require('lodash/fp');
module.exports = ({ strapi }) => ({
buildQueriesResolvers: ({ contentType }) => {
const { uid } = contentType;
return {
async find(parent, args) {
return strapi.entityService.find(uid, { params: args });
},
async findOne(parent, args) {
return strapi.entityService.findOne(uid, args.id, { params: omit('id', args) });
},
};
},
});