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