mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
cc @mattwr18 @tirokk @ulfgebhardt @appinteractive The factories don't use string interpolation now but they use variables. This resolves some errors of escaping strings when you send html along with `post.content`. It is much cleaner, too.
22 lines
481 B
JavaScript
22 lines
481 B
JavaScript
import faker from 'faker'
|
|
import uuid from 'uuid/v4'
|
|
|
|
export default function create (params) {
|
|
const {
|
|
id = uuid(),
|
|
name = faker.company.companyName(),
|
|
description = faker.company.catchPhrase()
|
|
} = params
|
|
|
|
return {
|
|
mutation: `
|
|
mutation($id: ID!, $name: String!, $description: String!) {
|
|
CreateOrganization(id: $id, name: $name, description: $description) {
|
|
name
|
|
}
|
|
}
|
|
`,
|
|
variables: { id, name, description }
|
|
}
|
|
}
|