mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-01-20 20:01:25 +00:00
41 lines
1.0 KiB
JavaScript
41 lines
1.0 KiB
JavaScript
import slug from 'slug'
|
|
|
|
export default {
|
|
Mutation: {
|
|
CreatePost: async (resolve, root, args, context, info) => {
|
|
args.slug = slug(args.title, {
|
|
lower: true
|
|
})
|
|
const result = await resolve(root, args, context, info)
|
|
return result
|
|
},
|
|
CreateUser: async (resolve, root, args, context, info) => {
|
|
if (!args.slug) {
|
|
args.slug = slug(args.name, {
|
|
lower: true
|
|
})
|
|
}
|
|
const result = await resolve(root, args, context, info)
|
|
return result
|
|
},
|
|
CreateOrganization: async (resolve, root, args, context, info) => {
|
|
if (!args.slug) {
|
|
args.slug = slug(args.name, {
|
|
lower: true
|
|
})
|
|
}
|
|
const result = await resolve(root, args, context, info)
|
|
return result
|
|
},
|
|
CreateCategory: async (resolve, root, args, context, info) => {
|
|
if (!args.slug) {
|
|
args.slug = slug(args.name, {
|
|
lower: true
|
|
})
|
|
}
|
|
const result = await resolve(root, args, context, info)
|
|
return result
|
|
}
|
|
}
|
|
}
|