From 90e1696f8669992004a3b3342d6b1dbe0f1472e1 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 20 Sep 2022 18:53:00 +0200 Subject: [PATCH] add group to post in schema --- backend/src/schema/types/type/Group.gql | 2 ++ backend/src/schema/types/type/Post.gql | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/backend/src/schema/types/type/Group.gql b/backend/src/schema/types/type/Group.gql index d586f6b53..ef94537fb 100644 --- a/backend/src/schema/types/type/Group.gql +++ b/backend/src/schema/types/type/Group.gql @@ -38,6 +38,8 @@ type Group { categories: [Category] @relation(name: "CATEGORIZED", direction: "OUT") myRole: GroupMemberRole # if 'null' then the current user is no member + + posts: [Post] @relation(name: "IN", direction: "IN") } diff --git a/backend/src/schema/types/type/Post.gql b/backend/src/schema/types/type/Post.gql index 2f9221dd1..434b44772 100644 --- a/backend/src/schema/types/type/Post.gql +++ b/backend/src/schema/types/type/Post.gql @@ -81,6 +81,7 @@ input _PostFilter { emotions_none: _PostEMOTEDFilter emotions_single: _PostEMOTEDFilter emotions_every: _PostEMOTEDFilter + group: ID } enum _PostOrdering { @@ -167,6 +168,8 @@ type Post { emotions: [EMOTED] emotionsCount: Int! @cypher(statement: "MATCH (this)<-[emoted:EMOTED]-(:User) RETURN COUNT(DISTINCT emoted)") + + group: Group @relation(name: "IN", direction: "OUT") } input _PostInput { @@ -184,6 +187,7 @@ type Mutation { language: String categoryIds: [ID] contentExcerpt: String + groupId: ID ): Post UpdatePost( id: ID!