|
|
@ -1,121 +1,100 @@
|
|
|
|
type Query {
|
|
|
|
type Query {
|
|
|
|
getUser(userId: Id): User
|
|
|
|
"returns the user object for a given user id"
|
|
|
|
getPost(postId: Id): Post
|
|
|
|
getUser(userId: ID): User
|
|
|
|
getChat(chatId: Id): Chat
|
|
|
|
"returns the post object for a post id"
|
|
|
|
getRequest(requestId: Id): Request
|
|
|
|
getPost(postId: ID): Post
|
|
|
|
|
|
|
|
"returns the chat object for a chat id"
|
|
|
|
|
|
|
|
getChat(chatId: ID): ChatRoom
|
|
|
|
|
|
|
|
"returns the request object for a request id"
|
|
|
|
|
|
|
|
getRequest(requestId: ID): Request
|
|
|
|
|
|
|
|
"find a post by the posted date or content"
|
|
|
|
|
|
|
|
findPost(first: Int, offset: Int, text: String!, postedDate: String): [Post]
|
|
|
|
|
|
|
|
"find a user by user name or handle"
|
|
|
|
|
|
|
|
findUser(first: Int, offset: Int, name: String!, handle: String!): [User]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type Mutation {
|
|
|
|
type Mutation {
|
|
|
|
#_____Post_____
|
|
|
|
"Upvote/downvote a Post"
|
|
|
|
#"Upvote/downvote a Post"
|
|
|
|
vote(postId: ID!, type: [VoteType!]!): Boolean
|
|
|
|
vote(postId: id!, type: [VoteType!]!): Bool
|
|
|
|
"Report the post"
|
|
|
|
#"Report the post"
|
|
|
|
report(postId: ID!): Boolean
|
|
|
|
report(postId: id!): Bool
|
|
|
|
"lets you accept a request for a given request id"
|
|
|
|
#_____Request_____
|
|
|
|
acceptRequest(requestId: ID!): Boolean
|
|
|
|
#"if u accept a request"
|
|
|
|
"send a message in a Chatroom"
|
|
|
|
acceptRequest(requestId: id!): bool
|
|
|
|
sendMessage(chatId: ID!, content: String!): Boolean
|
|
|
|
#_____ChatRoom_____
|
|
|
|
|
|
|
|
#"send a assage in a Chatroom"
|
|
|
|
|
|
|
|
sendMassage(chatId: Id!, massage: String!): bool
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"represents a single user account"
|
|
|
|
type User {
|
|
|
|
type User {
|
|
|
|
#"ProfilPicture of the User"
|
|
|
|
"url for the Profile picture of the User"
|
|
|
|
profilPicture: String!
|
|
|
|
profilePicture: String!
|
|
|
|
#"name from the User"
|
|
|
|
"name of the User"
|
|
|
|
name: String!
|
|
|
|
name: String!
|
|
|
|
#"unique name from the User"
|
|
|
|
"unique identifier name from the User"
|
|
|
|
handle: String!
|
|
|
|
handle: String!
|
|
|
|
#"Id from the User"
|
|
|
|
"Id of the User"
|
|
|
|
userId: ID!
|
|
|
|
id: ID!
|
|
|
|
#"Counted number of al Posts he posted"
|
|
|
|
"the total number of posts the user posted"
|
|
|
|
numberOfPosts: int
|
|
|
|
numberOfPosts: Int
|
|
|
|
#"show the posts of the User"
|
|
|
|
"returns a given number of posts of a user"
|
|
|
|
getAllPosts(first: int, offset: int): [Post]
|
|
|
|
getAllPosts(first: Int=10, offset: Int): [Post]
|
|
|
|
#"Date when he/she Created the account"
|
|
|
|
"creation date of the user account"
|
|
|
|
JoinedDate: Date!
|
|
|
|
joinedDate: String!
|
|
|
|
#"all chats for the mainsite(left)"
|
|
|
|
"returns chats the user pinned"
|
|
|
|
pinnedChats: [Chats]
|
|
|
|
pinnedChats: [ChatRoom]
|
|
|
|
#"all friends of the user"
|
|
|
|
"returns all friends of the user"
|
|
|
|
friends: [User]
|
|
|
|
friends: [User]
|
|
|
|
#"all request for groupChats/friends/events"
|
|
|
|
"all request for groupChats/friends/events"
|
|
|
|
friends: [Request]
|
|
|
|
requests: [Request]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"represents a single user post"
|
|
|
|
type Post {
|
|
|
|
type Post {
|
|
|
|
#"PicturePath"
|
|
|
|
"returns the path to the posts picture if it has one"
|
|
|
|
picture: String
|
|
|
|
picture: String
|
|
|
|
#"posted Text"
|
|
|
|
"returns the text of the post"
|
|
|
|
text: String
|
|
|
|
text: String
|
|
|
|
#"upvotes from Post"
|
|
|
|
"upvotes of the Post"
|
|
|
|
upvotes: Int!
|
|
|
|
upvotes: Int!
|
|
|
|
#"downvotes from Post"
|
|
|
|
"downvotes of the Post"
|
|
|
|
downvotes: Int!
|
|
|
|
downvotes: Int!
|
|
|
|
#"The AuthorID of the Post"
|
|
|
|
"the user that is the author of the Post"
|
|
|
|
author: User!
|
|
|
|
author: User!
|
|
|
|
#"Creationdate of the Post"
|
|
|
|
"date the post was created"
|
|
|
|
creationDate: Date!
|
|
|
|
creationDate: String!
|
|
|
|
#"Upvoteted/Downvoted the User already (NoVote(Null),Upvote,Downvote)"
|
|
|
|
"returns the type of vote the user performed on the post"
|
|
|
|
alreadyVoted: [VoteType]
|
|
|
|
alreadyVoted: VoteType
|
|
|
|
#"with tags u can find the post in a research"
|
|
|
|
"returns the tags of the post"
|
|
|
|
tags: [String]
|
|
|
|
tags: [String]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type Search {
|
|
|
|
"represents a request of any type"
|
|
|
|
#"u can find posts with a name(text) or posted time"
|
|
|
|
|
|
|
|
findPost(first: int, offset: int, text: String!, postedDate: Date): [Post]
|
|
|
|
|
|
|
|
#"u can find a User with his Name or handle"
|
|
|
|
|
|
|
|
findUser(first: int, offset: int, name: String!, handle: string!): [User]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type Request {
|
|
|
|
type Request {
|
|
|
|
#"RequestId"
|
|
|
|
"id of the request"
|
|
|
|
requestId: Id!
|
|
|
|
id: ID!
|
|
|
|
#"RequestType"
|
|
|
|
"type of the request"
|
|
|
|
requestType: [RequestType!]!
|
|
|
|
requestType: RequestType!
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"represents a chatroom"
|
|
|
|
type ChatRoom {
|
|
|
|
type ChatRoom {
|
|
|
|
#"Every User in the room"
|
|
|
|
"the members of the chatroom"
|
|
|
|
members: [Users!]
|
|
|
|
members: [User!]
|
|
|
|
#"Get the Chat"
|
|
|
|
"return a specfic range of messages posted in the chat"
|
|
|
|
getMessages(first: int, offset: int): [String]
|
|
|
|
getMessages(first: Int, offset: Int): [String]
|
|
|
|
#"chatId"
|
|
|
|
"id of the chat"
|
|
|
|
chatId: Id!
|
|
|
|
id: ID!
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"represents the type of vote performed on a post"
|
|
|
|
enum VoteType {
|
|
|
|
enum VoteType {
|
|
|
|
UPDATE
|
|
|
|
UPVOTE
|
|
|
|
DOWNVOTE
|
|
|
|
DOWNVOTE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"represents the type of request that the user has received"
|
|
|
|
enum RequestType {
|
|
|
|
enum RequestType {
|
|
|
|
FRIENDREQUEST
|
|
|
|
FRIENDREQUEST
|
|
|
|
GROUPINVITE
|
|
|
|
GROUPINVITE
|
|
|
|
EVENTINVITE
|
|
|
|
EVENTINVITE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#type Event {
|
|
|
|
|
|
|
|
#}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#type Comment {
|
|
|
|
|
|
|
|
# #"CommentId"
|
|
|
|
|
|
|
|
# commentId: Id!
|
|
|
|
|
|
|
|
# #"text from the Comment"
|
|
|
|
|
|
|
|
# text: String
|
|
|
|
|
|
|
|
# #"PostId"
|
|
|
|
|
|
|
|
# postId: Id
|
|
|
|
|
|
|
|
# #"Upvotes of the comment"
|
|
|
|
|
|
|
|
# upvotes: int!
|
|
|
|
|
|
|
|
# #"Downvotes of the comment"
|
|
|
|
|
|
|
|
# downvotes: int!
|
|
|
|
|
|
|
|
# #"Upvoteted/Downvoted the User already (NoVote(Null),Upvote,Downvote)"
|
|
|
|
|
|
|
|
# alreadyVoted: [VoteType]
|
|
|
|
|
|
|
|
# #"Creationdate of the Post"
|
|
|
|
|
|
|
|
# creationDate: Date!
|
|
|
|
|
|
|
|
#Comment
|
|
|
|
|
|
|
|
# #"Upvote/downvote a Comment"
|
|
|
|
|
|
|
|
# vote(CommentId: id!, type: [VoteType!]!): Bool
|
|
|
|
|
|
|
|
# #"Report the Comment"
|
|
|
|
|
|
|
|
# report(CommentId: id!): Bool
|
|
|
|
|
|
|
|
#}
|
|
|
|
|
|
|
|