scheme review, topic type added

This commit is contained in:
Untone 2021-07-27 07:51:16 +03:00
parent c604114c27
commit 0517dfc744

View File

@ -1,36 +1,13 @@
scalar DateTime scalar DateTime
################################### Inputs
input registerUserInput { input registerUserInput {
email: String! email: String!
username: String! username: String!
password: String! password: String!
} }
type signInPayload {
status: Boolean!
error: String
token: String
}
type ResultPayload {
status: Boolean!
error: String
}
type Like {
author: Int!
id: Int!
shout: Int
user: Int
value: Int!
}
type createMessagePayload {
status: Boolean!
error: String
message: Message
}
input MessageInput { input MessageInput {
body: String! body: String!
replyTo: Int replyTo: Int
@ -41,16 +18,27 @@ input updateMessageInput {
body: String! body: String!
} }
type Message { ################################### Payloads
author: Int!
body: String! type signInPayload {
createdAt: DateTime! status: Boolean!
id: Int! error: String
replyTo: Int token: String
updatedAt: DateTime!
visibleForUsers: [Int]
} }
type ResultPayload {
status: Boolean!
error: String
}
type createMessagePayload {
status: Boolean!
error: String
message: Message
}
################################### Mutation
type Mutation { type Mutation {
# message # message
createMessage(input: MessageInput!): createMessagePayload! createMessage(input: MessageInput!): createMessagePayload!
@ -77,6 +65,8 @@ type Mutation {
updateUsername(username: String!): User! updateUsername(username: String!): User!
} }
################################### Query
type Query { type Query {
# auth / user # auth / user
signIn(email: String!, password: String!): signInPayload! signIn(email: String!, password: String!): signInPayload!
@ -102,36 +92,7 @@ type Query {
topShouts: [Shout]! topShouts: [Shout]!
} }
type Role { ############################################ Subscription
id: Int!
name: String!
}
type Shout {
author: Int!
body: String!
createdAt: DateTime!
deletedAt: DateTime
deletedBy: Int
id: Int!
rating: Int
published: DateTime! # if there is no published field - it is not published
replyTo: Int # another shout
tags: [String]
title: String
updatedAt: DateTime!
versionOf: Int
visibleForRoles: [Role]!
visibleForUsers: [Int]
}
type Proposal {
body: String!
shout: Int!
range: String # full / 0:2340
author: Int!
createdAt: DateTime!
}
type Subscription { type Subscription {
messageCreated: Message! messageCreated: Message!
@ -143,13 +104,11 @@ type Subscription {
userUpdated: User! userUpdated: User!
} }
type Token { ############################################ Entities
createdAt: DateTime!
expiresAt: DateTime type Role {
id: Int! id: Int!
ownerId: Int! name: String!
usedAt: DateTime
value: String!
} }
type User { type User {
@ -166,3 +125,72 @@ type User {
userpicId: String userpicId: String
wasOnlineAt: DateTime wasOnlineAt: DateTime
} }
type Message {
author: Int!
body: String!
createdAt: DateTime!
id: Int!
replyTo: Int
updatedAt: DateTime!
visibleForUsers: [Int]
}
# is publication
type Shout {
id: Int! # TODO: replace with string? slugs-like-this
slug: String
author: Int!
body: String!
createdAt: DateTime!
deletedAt: DateTime
deletedBy: Int
rating: Int
published: DateTime! # if there is no published field - it is not published
replyTo: Int # another shout
tags: [String] # actual values
topics: [String] # topics-slugs
title: String
updatedAt: DateTime!
versionOf: Int
visibleForRoles: [Role]!
visibleForUsers: [Int]
}
type Topic {
slug: String
original: String
parents: [String] # NOTE: topic can have parent topics
children: [String] # and children
createdBy: User!
createdAt: DateTime!
}
# TODO: resolvers to add/remove topics from publication
type Proposal {
body: String!
shout: Int!
range: String # full / 0:2340
author: Int!
createdAt: DateTime!
}
type Token {
createdAt: DateTime!
expiresAt: DateTime
id: Int!
ownerId: Int!
usedAt: DateTime
value: String!
}
type Like {
author: Int!
id: Int!
shout: Int
user: Int
value: Int!
}