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,36 +3,36 @@ 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 {
@ -42,33 +42,33 @@ input ProfileInput {
} }
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
@ -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!