From 1b8e5cc0a3ea76b7d2672a981c6ff915e5f4604c Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 23 May 2023 01:50:06 +0200 Subject: [PATCH] correct our schema defintion --- backend/src/schema/types/schema.gql | 43 ++++++++++---------------- backend/src/schema/types/type/Post.gql | 3 ++ backend/src/schema/types/type/User.gql | 10 ++++++ 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/backend/src/schema/types/schema.gql b/backend/src/schema/types/schema.gql index b15179443..d59f696b2 100644 --- a/backend/src/schema/types/schema.gql +++ b/backend/src/schema/types/schema.gql @@ -1,30 +1,19 @@ -type Mutation { - # Get a JWT Token for the given Email and password - login(email: String!, password: String!): String! - changePassword(oldPassword: String!, newPassword: String!): String! - requestPasswordReset(email: String!): Boolean! - resetPassword(email: String!, nonce: String!, newPassword: String!): Boolean! - # Shout the given Type and ID - shout(id: ID!, type: ShoutTypeEnum): Boolean! - # Unshout the given Type and ID - unshout(id: ID!, type: ShoutTypeEnum): Boolean! - followUser(id: ID!): User - unfollowUser(id: ID!): User +type Embed { + type: String + title: String + author: String + publisher: String + date: String + description: String + url: String + image: String + audio: String + video: String + lang: String + html: String + sources: [String] } -enum ShoutTypeEnum { - Post -} - -type Reward { - id: ID! - user: User @relation(name: "REWARDED", direction: "IN") - rewarderId: ID - createdAt: String - badge: Badge @relation(name: "REWARDED", direction: "OUT") -} - -type SharedInboxEndpoint { - id: ID! - uri: String +type Query { + embed(url: String!): Embed } diff --git a/backend/src/schema/types/type/Post.gql b/backend/src/schema/types/type/Post.gql index 6fc7a3215..512671000 100644 --- a/backend/src/schema/types/type/Post.gql +++ b/backend/src/schema/types/type/Post.gql @@ -207,6 +207,9 @@ type Mutation { pinPost(id: ID!): Post unpinPost(id: ID!): Post markTeaserAsViewed(id: ID!): Post + + shout(id: ID!, type: String): Boolean + unshout(id: ID!, type: String): Boolean } type Query { diff --git a/backend/src/schema/types/type/User.gql b/backend/src/schema/types/type/User.gql index fe1ff43f0..378063ea4 100644 --- a/backend/src/schema/types/type/User.gql +++ b/backend/src/schema/types/type/User.gql @@ -214,10 +214,20 @@ type Mutation { muteUser(id: ID!): User unmuteUser(id: ID!): User + blockUser(id: ID!): User unblockUser(id: ID!): User + followUser(id: ID!): User + unfollowUser(id: ID!): User + switchUserRole(role: UserRole!, id: ID!): User saveCategorySettings(activeCategories: [String]): Boolean + + requestPasswordReset(email: String!): Boolean + resetPassword(nonce: String!, email: String!, newPassword: String!): Boolean + changePassword(oldPassword: String!, newPassword: String!): User + + login(email: String!, password: String!): User }