Robert Schäfer 0811ca8248 Massive refactoring of factories
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.
2019-04-18 16:41:34 +02:00

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 }
}
}