From 03d4c93f960dbf50d07dbb8f6bc673766242082a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Fri, 5 Apr 2019 01:23:33 +0200 Subject: [PATCH] Add Notification type --- backend/src/middleware/dateTimeMiddleware.js | 4 +++- backend/src/schema.graphql | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/backend/src/middleware/dateTimeMiddleware.js b/backend/src/middleware/dateTimeMiddleware.js index 73b75070c..11b6498a4 100644 --- a/backend/src/middleware/dateTimeMiddleware.js +++ b/backend/src/middleware/dateTimeMiddleware.js @@ -13,9 +13,11 @@ export default { CreatePost: setCreatedAt, CreateComment: setCreatedAt, CreateOrganization: setCreatedAt, + CreateNotification: setCreatedAt, UpdateUser: setUpdatedAt, UpdatePost: setUpdatedAt, UpdateComment: setUpdatedAt, - UpdateOrganization: setUpdatedAt + UpdateOrganization: setUpdatedAt, + UpdateNotification: setUpdatedAt } } diff --git a/backend/src/schema.graphql b/backend/src/schema.graphql index 3b1d95a95..5722500ea 100644 --- a/backend/src/schema.graphql +++ b/backend/src/schema.graphql @@ -69,6 +69,14 @@ type Statistics { countShouts: Int! } +type Notification { + id: ID! + read: Boolean, + user: User @relation(name: "NOTIFIED", direction: "OUT") + post: Post @relation(name: "NOTIFIED", direction: "IN") + createdAt: String +} + scalar Date scalar Time scalar DateTime