unify result format
This commit is contained in:
parent
2f7d4c20b1
commit
7b9543d388
|
@ -1,45 +1,13 @@
|
|||
scalar DateTime
|
||||
|
||||
################################### Inputs
|
||||
|
||||
input registerUserInput {
|
||||
email: String!
|
||||
username: String
|
||||
password: String!
|
||||
}
|
||||
|
||||
input MessageInput {
|
||||
body: String!
|
||||
replyTo: Int
|
||||
}
|
||||
|
||||
input updateMessageInput {
|
||||
id: Int!
|
||||
body: String!
|
||||
}
|
||||
|
||||
################################### Payloads
|
||||
|
||||
type signInPayload {
|
||||
status: Boolean!
|
||||
error: String
|
||||
token: String
|
||||
}
|
||||
################################### Payload
|
||||
|
||||
type ResultPayload {
|
||||
status: Boolean!
|
||||
error: String
|
||||
}
|
||||
|
||||
type createMessagePayload {
|
||||
status: Boolean!
|
||||
error: String
|
||||
token: String | Token
|
||||
user: User
|
||||
message: Message
|
||||
}
|
||||
|
||||
type createShoutPayload {
|
||||
status: Boolean!
|
||||
error: String
|
||||
shout: Shout
|
||||
}
|
||||
|
||||
|
@ -47,42 +15,39 @@ type createShoutPayload {
|
|||
|
||||
type Mutation {
|
||||
# message
|
||||
createMessage(input: MessageInput!): createMessagePayload!
|
||||
updateMessage(input: updateMessageInput!): createMessagePayload!
|
||||
createMessage(body: String!, replyTo: Int): ResultPayload!
|
||||
updateMessage(id: Int!, body: String!): ResultPayload!
|
||||
deleteMessage(messageId: Int!): ResultPayload!
|
||||
|
||||
# auth
|
||||
resetPassword(password: String!, token: String!): Token!
|
||||
confirmEmail(token: String!): Token!
|
||||
invalidateAllTokens: Boolean!
|
||||
invalidateTokenById(id: Int!): Boolean!
|
||||
requestEmailConfirmation: User!
|
||||
requestPasswordReset(email: String!): Boolean!
|
||||
resetPassword(password: String!, token: String!): Token!
|
||||
registerUser(input: registerUserInput!): User!
|
||||
signUp(email: String!, password: String!): ResultPayload!
|
||||
signIn(email: String!, password: String!): ResultPayload!
|
||||
|
||||
# shout
|
||||
createShout: Shout!
|
||||
deleteShout(shoutId: Int!): Boolean!
|
||||
rateShout(value: Int!): Boolean!
|
||||
createShout: ResultPayload!
|
||||
deleteShout(shoutId: Int!): ResultPayload!
|
||||
rateShout(value: Int!): ResultPayload!
|
||||
|
||||
# profile
|
||||
rateUser(value: Int!): Boolean!
|
||||
updateOnlineStatus: Boolean!
|
||||
updateUsername(username: String!): User!
|
||||
rateUser(value: Int!): ResultPayload!
|
||||
updateOnlineStatus: ResultPayload!
|
||||
updateUsername(username: String!): ResultPayload!
|
||||
}
|
||||
|
||||
################################### Query
|
||||
|
||||
type Query {
|
||||
# auth / user
|
||||
signIn(email: String!, password: String!): signInPayload!
|
||||
isEmailFree(email: String!): ResultPayload!
|
||||
signOut: ResultPayload!
|
||||
getCurrentUser: User!
|
||||
|
||||
isEmailFree(email: String!): Boolean!
|
||||
|
||||
getOnline: [User!]!
|
||||
getUserById(id: Int!): User!
|
||||
getCurrentUser: ResultPayload!
|
||||
getUserById(id: Int!): ResultPayload!
|
||||
getUserRating(shout: Int): Int!
|
||||
|
||||
# messages
|
||||
|
@ -94,6 +59,8 @@ type Query {
|
|||
shoutsByReplyTo(shout: Int): [Shout]!
|
||||
shoutsByTags(tags: [String]): [Shout]!
|
||||
shoutsByTime(time: DateTime): [Shout]!
|
||||
|
||||
getOnlineUsers: [User!]!
|
||||
topAuthors: [User]!
|
||||
topShouts: [Shout]!
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user