mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
16 lines
538 B
JavaScript
16 lines
538 B
JavaScript
import walkRecursive from '../helpers/walkRecursive'
|
|
import { cleanHtml } from '../middleware/helpers/cleanHtml.js'
|
|
|
|
const fields = ['content', 'contentExcerpt', 'reasonDescription']
|
|
|
|
export default {
|
|
Mutation: async (resolve, root, args, context, info) => {
|
|
args = walkRecursive(args, fields, cleanHtml)
|
|
return resolve(root, args, context, info)
|
|
},
|
|
Query: async (resolve, root, args, context, info) => {
|
|
const result = await resolve(root, args, context, info)
|
|
return walkRecursive(result, fields, cleanHtml)
|
|
},
|
|
}
|