roschaefer 178143dfb7 refactor(modules): Various import fixes
* DRY schema stitching code
* Use same `.env` configuration file for cypress tests

That last part I couldn't improve a lot. I thought it might be possible
with cypress to import all files from a folder. But since it must be
browser compatible and our backend is not using webpack or anything,
it remains a goal unreached.

close #2773
close #2774
2020-01-17 15:59:19 +01:00

43 lines
1.1 KiB
JavaScript

import uuid from 'uuid/v4'
export default {
id: { type: 'string', primary: true, default: uuid },
createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() },
updatedAt: {
type: 'string',
isoDate: true,
required: true,
default: () => new Date().toISOString(),
},
content: { type: 'string', disallow: [null], min: 3 },
contentExcerpt: { type: 'string', allow: [null] },
deleted: { type: 'boolean', default: false },
disabled: { type: 'boolean', default: false },
post: {
type: 'relationship',
relationship: 'COMMENTS',
target: 'Post',
direction: 'out',
},
author: {
type: 'relationship',
relationship: 'WROTE',
target: 'User',
direction: 'in',
},
notified: {
type: 'relationship',
relationship: 'NOTIFIED',
target: 'User',
direction: 'out',
properties: {
read: { type: 'boolean', default: false },
reason: {
type: 'string',
valid: ['mentioned_in_post', 'mentioned_in_comment', 'commented_on_post'],
},
createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() },
},
},
}