mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
22 lines
588 B
JavaScript
22 lines
588 B
JavaScript
import walkRecursive from '../helpers/walkRecursive'
|
|
import { cleanHtml } from '../middleware/helpers/cleanHtml.js'
|
|
|
|
const fields = [
|
|
'content',
|
|
'contentExcerpt',
|
|
'reasonDescription',
|
|
'description',
|
|
'descriptionExcerpt',
|
|
]
|
|
|
|
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)
|
|
},
|
|
}
|