mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
35 lines
721 B
JavaScript
35 lines
721 B
JavaScript
import faker from 'faker'
|
|
import uuid from 'uuid/v4'
|
|
|
|
export default function (params) {
|
|
const {
|
|
id = uuid(),
|
|
slug = '',
|
|
title = faker.lorem.sentence(),
|
|
content = [
|
|
faker.lorem.sentence(),
|
|
faker.lorem.sentence(),
|
|
faker.lorem.sentence(),
|
|
faker.lorem.sentence(),
|
|
faker.lorem.sentence()
|
|
].join('. '),
|
|
image = faker.image.image(),
|
|
visibility = 'public',
|
|
deleted = false
|
|
} = params
|
|
|
|
return `
|
|
mutation {
|
|
CreatePost(
|
|
id: "${id}",
|
|
slug: "${slug}",
|
|
title: "${title}",
|
|
content: "${content}",
|
|
image: "${image}",
|
|
visibility: ${visibility},
|
|
deleted: ${deleted}
|
|
) { title, content }
|
|
}
|
|
`
|
|
}
|