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