This commit is contained in:
Untone 2021-08-21 03:40:41 +03:00
parent de6d4c47a3
commit 8cef32c7a4
2 changed files with 43 additions and 41 deletions

View File

@ -26,7 +26,9 @@ bson2json.json_tables() # creates all the needed data json from bson mongodump
```sh ```sh
pipenv run python migrate.py users pipenv run python migrate.py users
``` ```
Note: this will create db entries and it is not tolerant to existed unique email.
Note: this will create db entries and it is not tolerant to existed unique
email.
3. then topics and shouts 3. then topics and shouts
@ -35,4 +37,5 @@ pipenv run python migrate.py topics
pipenv run python migrate.py shouts pipenv run python migrate.py shouts
``` ```
Now you got the *.dict.json files which contain all the data with old and new(!) ids. Now you got the \*.dict.json files which contain all the data with old and
new(!) ids.

View File

@ -3,72 +3,72 @@ scalar DateTime
################################### Payload ################################### Payload
type Result { type Result {
error: String error: String
} }
type AuthResult { type AuthResult {
error: String error: String
token: String token: String
user: User user: User
} }
type UserResult { type UserResult {
error: String error: String
user: User user: User
} }
type MessageResult { type MessageResult {
error: String error: String
message: Message message: Message
} }
input ShoutInput { input ShoutInput {
org_id: Int! org_id: Int!
slug: String! slug: String!
body: String! body: String!
replyTo: String # another shout replyTo: String # another shout
tags: [String] # actual values tags: [String] # actual values
topics: [String] # topic-slugs topics: [String] # topic-slugs
title: String title: String
versionOf: String versionOf: String
visibleForRoles: [String] # role ids are strings visibleForRoles: [String] # role ids are strings
visibleForUsers: [Int] visibleForUsers: [Int]
} }
input ProfileInput { input ProfileInput {
email: String email: String
username: String username: String
userpic: String userpic: String
} }
type ShoutResult { type ShoutResult {
error: String error: String
shout: Shout shout: Shout
} }
################################### Mutation ################################### Mutation
type Mutation { type Mutation {
# message # message
createMessage(body: String!, replyTo: Int): MessageResult! createMessage(body: String!, replyTo: Int): MessageResult!
updateMessage(id: Int!, body: String!): MessageResult! updateMessage(id: Int!, body: String!): MessageResult!
deleteMessage(messageId: Int!): Result! deleteMessage(messageId: Int!): Result!
# auth # auth
confirmEmail(token: String!): AuthResult! confirmEmail(token: String!): AuthResult!
requestPasswordReset(email: String!): Boolean! requestPasswordReset(email: String!): Boolean!
confirmPasswordReset(token: String!): Boolean! confirmPasswordReset(token: String!): Boolean!
registerUser(email: String!, password: String!): AuthResult! registerUser(email: String!, password: String!): AuthResult!
# updatePassword(password: String!, token: String!): Token! # updatePassword(password: String!, token: String!): Token!
# invalidateAllTokens: Boolean! # invalidateAllTokens: Boolean!
# invalidateTokenById(id: Int!): Boolean! # invalidateTokenById(id: Int!): Boolean!
# requestEmailConfirmation: User! # requestEmailConfirmation: User!
# shout # shout
createShout(input: ShoutInput!): ShoutResult! createShout(input: ShoutInput!): ShoutResult!
updateShout(input: ShoutInput!): ShoutResult! updateShout(input: ShoutInput!): ShoutResult!
deleteShout(slug: String!): Result! deleteShout(slug: String!): Result!
rateShout(slug: String!, value: Int!): Result! rateShout(slug: String!, value: Int!): Result!
# user profile # user profile
# rateUser(value: Int!): Result! # rateUser(value: Int!): Result!
@ -80,11 +80,11 @@ type Mutation {
type Query { type Query {
# auth # auth
isEmailFree(email: String!): Result! isEmailFree(email: String!): Result!
signIn(email: String!, password: String!): AuthResult! signIn(email: String!, password: String!): AuthResult!
signOut: Result! signOut: Result!
# user profile # user profile
getCurrentUser: UserResult! getCurrentUser: UserResult!
getUserById(id: Int!): UserResult! getUserById(id: Int!): UserResult!
# getUserRating(shout: Int): Int! # getUserRating(shout: Int): Int!
@ -99,8 +99,8 @@ type Query {
# shoutsByTime(time: DateTime): [Shout]! # shoutsByTime(time: DateTime): [Shout]!
# getOnlineUsers: [User!]! # getOnlineUsers: [User!]!
topAuthors: [User]! topAuthors: [User]!
topShouts: [Shout]! topShouts: [Shout]!
} }
############################################ Subscription ############################################ Subscription
@ -109,7 +109,7 @@ type Subscription {
messageCreated: Message! messageCreated: Message!
messageUpdated: Message! messageUpdated: Message!
messageDeleted: Message! messageDeleted: Message!
onlineUpdated: [User!]! onlineUpdated: [User!]!
shoutUpdated: Shout! shoutUpdated: Shout!
userUpdated: User! userUpdated: User!
@ -163,7 +163,7 @@ type User {
ratings: [Rating] ratings: [Rating]
slug: String slug: String
bio: String bio: String
notifications: [Int] notifications: [Int]
} }
type Message { type Message {
@ -190,7 +190,7 @@ type Shout {
deletedBy: Int deletedBy: Int
rating: Int rating: Int
ratigns: [Rating] ratigns: [Rating]
published: Boolean! published: Boolean!
publishedAt: DateTime # if there is no published field - it is not published publishedAt: DateTime # if there is no published field - it is not published
replyTo: String # another shout replyTo: String # another shout
tags: [String] # actual values tags: [String] # actual values
@ -214,7 +214,6 @@ type Topic {
# TODO: resolvers to add/remove topics from publication # TODO: resolvers to add/remove topics from publication
type Proposal { type Proposal {
body: String! body: String!
shout: Int! shout: Int!