2021-08-20 23:17:15 +00:00
|
|
|
scalar DateTime
|
|
|
|
|
2022-07-21 11:58:50 +00:00
|
|
|
################################### Payload ###################################
|
2021-08-20 23:17:15 +00:00
|
|
|
|
2022-05-03 12:55:29 +00:00
|
|
|
type CurrentUserInfo {
|
2022-07-21 11:58:50 +00:00
|
|
|
inbox: Int
|
|
|
|
topics: [String]!
|
|
|
|
authors: [String]!
|
|
|
|
reactions: [String]!
|
|
|
|
communities: [String]!
|
2022-05-03 12:55:29 +00:00
|
|
|
}
|
|
|
|
|
2021-08-20 23:17:15 +00:00
|
|
|
type AuthResult {
|
2022-02-03 09:13:53 +00:00
|
|
|
error: String
|
|
|
|
token: String
|
|
|
|
user: User
|
2022-05-03 12:55:29 +00:00
|
|
|
info: CurrentUserInfo
|
2021-08-20 23:17:15 +00:00
|
|
|
}
|
|
|
|
|
2022-07-21 11:58:50 +00:00
|
|
|
type Result {
|
2022-02-03 09:13:53 +00:00
|
|
|
error: String
|
2022-07-21 11:58:50 +00:00
|
|
|
shout: Shout
|
|
|
|
shouts: [Shout]
|
|
|
|
author: User
|
|
|
|
authors: [User]
|
|
|
|
reaction: Reaction
|
|
|
|
reactions: [Reaction]
|
|
|
|
topic: Topic
|
|
|
|
topics: [Topic]
|
|
|
|
community: Community
|
|
|
|
communities: [Community]
|
|
|
|
}
|
|
|
|
|
|
|
|
enum ReactionStatus {
|
|
|
|
NEW
|
|
|
|
UPDATED
|
|
|
|
CHANGED
|
|
|
|
EXPLAINED
|
|
|
|
DELETED
|
|
|
|
}
|
|
|
|
|
|
|
|
type ReactionUpdating {
|
|
|
|
error: String
|
|
|
|
status: ReactionStatus
|
|
|
|
reaction: Reaction
|
2021-08-20 23:17:15 +00:00
|
|
|
}
|
|
|
|
|
2022-07-21 11:58:50 +00:00
|
|
|
################################### Inputs ###################################
|
|
|
|
|
2021-08-20 23:17:15 +00:00
|
|
|
input ShoutInput {
|
2022-02-03 09:13:53 +00:00
|
|
|
slug: String!
|
|
|
|
body: String!
|
2022-06-28 19:40:44 +00:00
|
|
|
community: String!
|
2022-02-03 09:13:53 +00:00
|
|
|
mainTopic: String
|
|
|
|
topic_slugs: [String]
|
|
|
|
title: String
|
|
|
|
subtitle: String
|
|
|
|
versionOf: String
|
|
|
|
visibleForRoles: [String] # role ids are strings
|
|
|
|
visibleForUsers: [Int]
|
2021-08-21 00:40:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
input ProfileInput {
|
2022-02-03 09:13:53 +00:00
|
|
|
name: String
|
|
|
|
userpic: String
|
|
|
|
links: [String]
|
|
|
|
bio: String
|
2021-08-20 23:17:15 +00:00
|
|
|
}
|
|
|
|
|
2021-11-26 00:41:20 +00:00
|
|
|
input CommunityInput {
|
2022-02-03 09:13:53 +00:00
|
|
|
title: String!
|
|
|
|
desc: String
|
|
|
|
pic: String
|
2021-11-26 00:41:20 +00:00
|
|
|
}
|
|
|
|
|
2021-12-12 15:29:51 +00:00
|
|
|
input TopicInput {
|
2022-02-03 09:13:53 +00:00
|
|
|
slug: String!
|
2022-07-21 11:58:50 +00:00
|
|
|
community: String!
|
2022-02-03 09:13:53 +00:00
|
|
|
title: String
|
|
|
|
body: String
|
|
|
|
pic: String
|
|
|
|
children: [String]
|
2022-07-21 11:58:50 +00:00
|
|
|
parents: [String]
|
2022-01-28 09:49:46 +00:00
|
|
|
}
|
|
|
|
|
2022-07-21 11:58:50 +00:00
|
|
|
input ReactionInput {
|
|
|
|
kind: Int!
|
|
|
|
shout: String!
|
|
|
|
range: String
|
|
|
|
body: String
|
|
|
|
replyTo: Int
|
2022-01-28 09:49:46 +00:00
|
|
|
}
|
|
|
|
|
2022-07-21 11:58:50 +00:00
|
|
|
enum FollowingEntity {
|
2022-06-12 07:51:22 +00:00
|
|
|
TOPIC
|
|
|
|
AUTHOR
|
|
|
|
COMMUNITY
|
2022-07-21 11:58:50 +00:00
|
|
|
REACTIONS
|
2022-06-12 07:51:22 +00:00
|
|
|
}
|
|
|
|
|
2021-08-20 23:17:15 +00:00
|
|
|
################################### Mutation
|
|
|
|
|
|
|
|
type Mutation {
|
2022-02-03 09:13:53 +00:00
|
|
|
# auth
|
|
|
|
confirmEmail(token: String!): AuthResult!
|
|
|
|
registerUser(email: String!, password: String): AuthResult!
|
|
|
|
requestPasswordUpdate(email: String!): Result!
|
|
|
|
updatePassword(password: String!, token: String!): Result!
|
|
|
|
# requestEmailConfirmation: User!
|
|
|
|
|
|
|
|
# shout
|
2022-07-21 11:58:50 +00:00
|
|
|
createShout(input: ShoutInput!): Result!
|
|
|
|
updateShout(input: ShoutInput!): Result!
|
2022-02-03 09:13:53 +00:00
|
|
|
deleteShout(slug: String!): Result!
|
|
|
|
viewShout(slug: String!): Result!
|
2022-07-21 11:58:50 +00:00
|
|
|
viewReaction(reaction_id: Int!): Result!
|
2022-02-03 09:13:53 +00:00
|
|
|
|
|
|
|
# user profile
|
2022-02-16 12:38:05 +00:00
|
|
|
rateUser(slug: String!, value: Int!): Result!
|
2022-02-03 09:13:53 +00:00
|
|
|
# updateOnlineStatus: Result!
|
|
|
|
updateProfile(profile: ProfileInput!): Result!
|
|
|
|
|
|
|
|
# topics
|
2022-07-21 11:58:50 +00:00
|
|
|
createTopic(input: TopicInput!): Result!
|
|
|
|
# TODO: mergeTopics(t1: String!, t2: String!): Result!
|
|
|
|
updateTopic(input: TopicInput!): Result!
|
|
|
|
destroyTopic(slug: String!): Result!
|
2022-02-03 09:13:53 +00:00
|
|
|
|
2022-07-21 11:58:50 +00:00
|
|
|
|
|
|
|
# reactions
|
|
|
|
createReaction(input: ReactionInput!): Result!
|
|
|
|
updateReaction(id: Int!, body: String!): Result!
|
|
|
|
deleteReaction(id: Int!): Result!
|
|
|
|
rateReaction(id: Int!, value: Int!): Result!
|
2022-02-03 09:13:53 +00:00
|
|
|
|
2022-06-19 17:54:39 +00:00
|
|
|
# community
|
2022-07-21 11:58:50 +00:00
|
|
|
createCommunity(community: CommunityInput!): Result!
|
|
|
|
updateCommunity(community: CommunityInput!): Result!
|
2022-06-28 19:40:44 +00:00
|
|
|
deleteCommunity(slug: String!): Result!
|
2022-02-03 09:13:53 +00:00
|
|
|
|
2022-06-22 05:28:42 +00:00
|
|
|
# collab
|
|
|
|
inviteAuthor(author: String!, shout: String!): Result!
|
|
|
|
removeAuthor(author: String!, shout: String!): Result!
|
2022-07-21 11:58:50 +00:00
|
|
|
|
|
|
|
# following
|
|
|
|
follow(what: FollowingEntity!, slug: String!): Result!
|
|
|
|
unfollow(what: FollowingEntity!, slug: String!): Result!
|
|
|
|
|
|
|
|
# TODO: transform reaction with body to shout
|
|
|
|
|
|
|
|
# NOTE: so-named 'collections' are tuned feeds
|
|
|
|
# TODO: Feed entity and CRUM: createFeed updateFeed deleteFeed mergeFeeds
|
2021-08-20 23:17:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
################################### Query
|
|
|
|
|
|
|
|
type Query {
|
2022-07-13 15:53:06 +00:00
|
|
|
|
2022-02-03 09:13:53 +00:00
|
|
|
# auth
|
2022-06-15 12:41:28 +00:00
|
|
|
isEmailUsed(email: String!): Boolean!
|
2022-02-03 09:13:53 +00:00
|
|
|
signIn(email: String!, password: String): AuthResult!
|
2022-07-21 11:58:50 +00:00
|
|
|
signOut: AuthResult!
|
|
|
|
forget(email: String!): AuthResult!
|
|
|
|
requestPasswordReset(email: String!): AuthResult!
|
|
|
|
updatePassword(password: String!, token: String!): AuthResult!
|
|
|
|
getCurrentUser: AuthResult!
|
2022-02-03 09:13:53 +00:00
|
|
|
|
|
|
|
# profile
|
|
|
|
getUsersBySlugs(slugs: [String]!): [User]!
|
2022-07-21 11:58:50 +00:00
|
|
|
userFollowers(slug: String!): [User]!
|
|
|
|
userFollowedAuthors(slug: String!): [User]!
|
|
|
|
userFollowedTopics(slug: String!): [Topic]!
|
|
|
|
userFollowedCommunities(slug: String!): [Community]!
|
|
|
|
userReactedShouts(slug: String!): [Shout]! # test
|
2022-02-03 09:13:53 +00:00
|
|
|
getUserRoles(slug: String!): [Role]!
|
2022-07-28 03:44:56 +00:00
|
|
|
authorsAll: [User]!
|
2022-04-28 09:04:14 +00:00
|
|
|
|
2022-02-03 09:13:53 +00:00
|
|
|
# shouts
|
|
|
|
getShoutBySlug(slug: String!): Shout!
|
2022-07-21 11:58:50 +00:00
|
|
|
shoutsForFeed(page: Int!, size: Int!): [Shout]! # test
|
2022-05-31 07:03:50 +00:00
|
|
|
shoutsByTopics(slugs: [String]!, page: Int!, size: Int!): [Shout]!
|
|
|
|
shoutsByAuthors(slugs: [String]!, page: Int!, size: Int!): [Shout]!
|
|
|
|
shoutsByCommunities(slugs: [String]!, page: Int!, size: Int!): [Shout]!
|
2022-07-21 11:58:50 +00:00
|
|
|
myCandidates(page: Int!, size: Int!): [Shout]! # test
|
2022-02-03 09:13:53 +00:00
|
|
|
topViewed(page: Int!, size: Int!): [Shout]!
|
2022-07-21 11:58:50 +00:00
|
|
|
# TODO: topReacted(page: Int!, size: Int!): [Shout]!
|
2022-02-03 09:13:53 +00:00
|
|
|
topMonth(page: Int!, size: Int!): [Shout]!
|
|
|
|
topOverall(page: Int!, size: Int!): [Shout]!
|
2022-07-21 11:58:50 +00:00
|
|
|
recentPublished(page: Int!, size: Int!): [Shout]! # homepage
|
|
|
|
recentReacted(page: Int!, size: Int!): [Shout]! # test
|
2022-06-11 22:05:20 +00:00
|
|
|
recentAll(page: Int!, size: Int!): [Shout]!
|
2022-07-21 11:58:50 +00:00
|
|
|
|
|
|
|
# reactons
|
|
|
|
reactionsAll(page: Int!, size: Int!): [Reaction]!
|
|
|
|
reactionsByAuthor(slug: String!, page: Int!, size: Int!): [Reaction]!
|
|
|
|
reactionsByShout(slug: String!): [Reaction]!
|
|
|
|
|
|
|
|
# collab
|
|
|
|
inviteAuthor(slug: String!, author: String!): Result!
|
|
|
|
removeAuthor(slug: String!, author: String!): Result
|
2022-02-03 09:13:53 +00:00
|
|
|
|
|
|
|
# topics
|
2022-07-13 15:53:06 +00:00
|
|
|
topicsAll(page: Int!, size: Int!): [Topic]!
|
2022-02-03 09:13:53 +00:00
|
|
|
topicsByCommunity(community: String!): [Topic]!
|
|
|
|
topicsByAuthor(author: String!): [Topic]!
|
|
|
|
|
|
|
|
# communities
|
|
|
|
getCommunity(slug: String): Community!
|
2022-07-21 11:58:50 +00:00
|
|
|
getCommunities: [Community]! # all
|
2021-08-20 23:17:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
############################################ Subscription
|
|
|
|
|
|
|
|
type Subscription {
|
2022-02-03 09:13:53 +00:00
|
|
|
onlineUpdated: [User!]!
|
|
|
|
shoutUpdated: Shout!
|
|
|
|
userUpdated: User!
|
2022-07-21 11:58:50 +00:00
|
|
|
reactionUpdated(shout: String!): ReactionUpdating!
|
2021-08-20 23:17:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
############################################ Entities
|
|
|
|
|
2021-11-24 09:09:47 +00:00
|
|
|
type Resource {
|
2022-02-03 09:13:53 +00:00
|
|
|
id: Int!
|
|
|
|
name: String!
|
2021-11-24 09:09:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Operation {
|
2022-02-03 09:13:53 +00:00
|
|
|
id: Int!
|
|
|
|
name: String!
|
2021-11-24 09:09:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Permission {
|
2022-02-03 09:13:53 +00:00
|
|
|
operation_id: Int!
|
|
|
|
resource_id: Int!
|
2021-11-24 09:09:47 +00:00
|
|
|
}
|
|
|
|
|
2021-08-20 23:17:15 +00:00
|
|
|
type Role {
|
2022-02-03 09:13:53 +00:00
|
|
|
id: Int!
|
|
|
|
name: String!
|
2022-06-28 19:40:44 +00:00
|
|
|
community: String!
|
2022-02-03 09:13:53 +00:00
|
|
|
desc: String
|
|
|
|
permissions: [Permission!]!
|
2021-08-20 23:17:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Rating {
|
2022-02-03 09:13:53 +00:00
|
|
|
rater: String!
|
|
|
|
value: Int!
|
2022-01-11 13:33:25 +00:00
|
|
|
}
|
|
|
|
|
2021-08-20 23:17:15 +00:00
|
|
|
type Notification {
|
2022-02-03 09:13:53 +00:00
|
|
|
kind: String! # unique primary key
|
|
|
|
template: String!
|
|
|
|
variables: [String]
|
2021-08-20 23:17:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type UserNotification {
|
2022-02-03 09:13:53 +00:00
|
|
|
id: Int! # primary key
|
|
|
|
user: Int!
|
|
|
|
kind: String! # NotificationTemplate.name
|
|
|
|
values: [String]
|
2021-08-20 23:17:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type User {
|
2022-02-03 09:13:53 +00:00
|
|
|
id: Int!
|
|
|
|
username: String! # to login, ex. email
|
|
|
|
createdAt: DateTime!
|
|
|
|
slug: String!
|
|
|
|
name: String # to display
|
|
|
|
email: String
|
|
|
|
password: String
|
|
|
|
oauth: String # provider:token
|
|
|
|
userpic: String
|
|
|
|
links: [String]
|
|
|
|
emailConfirmed: Boolean # should contain all emails too
|
|
|
|
muted: Boolean
|
|
|
|
updatedAt: DateTime
|
|
|
|
wasOnlineAt: DateTime
|
|
|
|
ratings: [Rating]
|
|
|
|
bio: String
|
|
|
|
notifications: [Int]
|
|
|
|
communities: [Int] # user participating communities
|
2022-07-07 13:55:13 +00:00
|
|
|
oid: String
|
2021-08-20 23:17:15 +00:00
|
|
|
}
|
|
|
|
|
2022-07-21 11:58:50 +00:00
|
|
|
enum ReactionKind {
|
|
|
|
LIKE
|
|
|
|
DISLIKE
|
|
|
|
|
|
|
|
AGREE
|
|
|
|
DISAGREE
|
|
|
|
|
|
|
|
PROOF
|
|
|
|
DISPROOF
|
|
|
|
|
|
|
|
COMMENT
|
2022-07-25 09:34:57 +00:00
|
|
|
QUOTE
|
2022-07-21 11:58:50 +00:00
|
|
|
|
|
|
|
PROPOSE
|
|
|
|
ASK
|
|
|
|
|
|
|
|
ACCEPT
|
|
|
|
REJECT
|
|
|
|
}
|
|
|
|
|
|
|
|
type Reaction {
|
2022-02-03 09:13:53 +00:00
|
|
|
id: Int!
|
2022-07-21 11:58:50 +00:00
|
|
|
shout: Shout!
|
2022-02-03 09:13:53 +00:00
|
|
|
createdAt: DateTime!
|
2022-07-21 11:58:50 +00:00
|
|
|
createdBy: User!
|
2022-02-03 09:13:53 +00:00
|
|
|
updatedAt: DateTime
|
|
|
|
deletedAt: DateTime
|
2022-07-07 13:55:13 +00:00
|
|
|
deletedBy: User
|
2022-07-21 11:58:50 +00:00
|
|
|
range: String # full / 0:2340
|
|
|
|
kind: ReactionKind!
|
|
|
|
body: String
|
|
|
|
replyTo: Reaction
|
|
|
|
stat: Stat
|
|
|
|
old_id: String
|
2022-02-03 09:13:53 +00:00
|
|
|
old_thread: String
|
2021-10-13 17:46:30 +00:00
|
|
|
}
|
2021-09-03 16:01:31 +00:00
|
|
|
|
2022-08-05 15:55:07 +00:00
|
|
|
type Author {
|
|
|
|
slug: String!
|
|
|
|
name: String!
|
|
|
|
userpic: String
|
2022-08-05 16:04:54 +00:00
|
|
|
caption: String # only for full shout
|
2022-08-05 15:55:07 +00:00
|
|
|
}
|
|
|
|
|
2021-08-20 23:17:15 +00:00
|
|
|
# is publication
|
|
|
|
type Shout {
|
2022-06-14 06:13:06 +00:00
|
|
|
id: Int!
|
2022-02-03 09:13:53 +00:00
|
|
|
slug: String!
|
|
|
|
body: String!
|
|
|
|
createdAt: DateTime!
|
2022-08-05 15:55:07 +00:00
|
|
|
authors: [Author!]!
|
2022-07-21 11:58:50 +00:00
|
|
|
# ratings: [Rating]
|
2022-06-28 19:40:44 +00:00
|
|
|
community: String
|
2022-02-03 09:13:53 +00:00
|
|
|
cover: String
|
|
|
|
layout: String
|
2022-07-07 13:55:13 +00:00
|
|
|
draft: Boolean
|
|
|
|
versionOf: Shout # translations and adaptations
|
|
|
|
visibleFor: [User]
|
2022-02-03 09:13:53 +00:00
|
|
|
topics: [Topic]
|
|
|
|
mainTopic: String
|
|
|
|
title: String
|
|
|
|
subtitle: String
|
|
|
|
updatedAt: DateTime
|
2022-07-07 13:55:13 +00:00
|
|
|
updatedBy: User
|
2022-02-03 09:13:53 +00:00
|
|
|
deletedAt: DateTime
|
2022-07-07 13:55:13 +00:00
|
|
|
deletedBy: User
|
|
|
|
publishedBy: User
|
2022-02-03 09:13:53 +00:00
|
|
|
publishedAt: DateTime
|
2022-07-21 11:58:50 +00:00
|
|
|
stat: Stat
|
2021-12-17 10:22:31 +00:00
|
|
|
}
|
|
|
|
|
2022-07-21 11:58:50 +00:00
|
|
|
type Stat {
|
|
|
|
viewed: Int!
|
|
|
|
reacted: Int!
|
2021-08-20 23:17:15 +00:00
|
|
|
}
|
|
|
|
|
2021-08-26 21:14:20 +00:00
|
|
|
type Community {
|
2022-02-03 09:13:53 +00:00
|
|
|
slug: String!
|
|
|
|
name: String!
|
|
|
|
desc: String
|
|
|
|
pic: String!
|
2022-06-16 11:44:36 +00:00
|
|
|
createdAt: DateTime!
|
|
|
|
createdBy: User!
|
2021-08-26 21:14:20 +00:00
|
|
|
}
|
|
|
|
|
2021-12-13 16:51:01 +00:00
|
|
|
type TopicStat {
|
2022-02-03 09:13:53 +00:00
|
|
|
shouts: Int!
|
2022-07-21 11:58:50 +00:00
|
|
|
followers: Int!
|
2022-02-03 09:13:53 +00:00
|
|
|
authors: Int!
|
2022-07-21 11:58:50 +00:00
|
|
|
viewed: Int!
|
2021-12-13 16:51:01 +00:00
|
|
|
}
|
|
|
|
|
2021-08-20 23:17:15 +00:00
|
|
|
type Topic {
|
2022-02-03 09:13:53 +00:00
|
|
|
slug: String! # ID
|
|
|
|
title: String
|
|
|
|
body: String
|
|
|
|
pic: String
|
|
|
|
parents: [String] # NOTE: topic can have parent topics
|
|
|
|
children: [String] # and children
|
2022-07-21 11:58:50 +00:00
|
|
|
community: Community!
|
2022-07-13 15:53:06 +00:00
|
|
|
stat: TopicStat
|
2022-07-07 13:55:13 +00:00
|
|
|
oid: String
|
2021-08-20 23:17:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Token {
|
2022-02-03 09:13:53 +00:00
|
|
|
createdAt: DateTime!
|
|
|
|
expiresAt: DateTime
|
|
|
|
id: Int!
|
|
|
|
ownerId: Int!
|
|
|
|
usedAt: DateTime
|
|
|
|
value: String!
|
2021-08-28 10:13:50 +00:00
|
|
|
}
|