Add comment about gql single type resolve validation

This commit is contained in:
Convly 2023-08-24 14:38:47 +02:00
parent 8c212ec85f
commit 8ceaa69cc0

View File

@ -98,9 +98,11 @@ module.exports = ({ strapi }) => {
.get('content-api')
.buildMutationsResolvers({ contentType });
await validate.contentAPI.query(transformedArgs, contentType, {
auth: ctx?.state?.auth,
});
// For single types, the validation and sanitization of args is done here instead of being
// delegated to the query builders since we're calling the entity service directly
await validate.contentAPI.query(transformedArgs, contentType, { auth: ctx?.state?.auth });
const sanitizedQuery = await sanitize.contentAPI.query(transformedArgs, contentType, {
auth: ctx?.state?.auth,
});