---
# System prepended metadata

title: Untitled

---

```graphql=
schema {
    query: Query
    mutation: Mutation
}

directive @isAdmin on FIELD_DEFINITION
directive @isSelfUser on FIELD_DEFINITION

type User {
    id: Guid!
    phoneNumber: String! @isSelfUser @isAdmin
    nickname: String!
    bio: String!
    photo: String
}

type Session {
    id: Guid!
    user: User!
    ip: String!
    accessToken: String!
    accessTokenExpiryDate: DateTime!
}

type Post {
    id: Guid!
    user: User!
    photo: String!
    reports: Reports @isAdmin
}

enum ReactionType {
    like
    dislike
    favorite
}

type Reaction {
    id: Guid!
    user: User!
    post: Post!
    type: ReactionType
}

type Recomendation {
    id: Guid!
    user: User!
    post: Post!
}

enum ReportType {
  spam
  harassment
  adultContent
  childPornography
  drugAdvocacy
  sellingWeapons
  violence
  encouragingBullying
  encouragingSuicide
  animalAbuse
  misleadingInformation
  fraud
  extremism
  hateSpeech
  nonOriginalContent
}

type PostReport {
    id: Guid!
    user: User!
    post: Post!
    type: ReportType!
}

type UserReport {
    id Guid!
    user: User!
    accusedUser: User!
    type: ReportType!
}

input NewUser {
    nickname: String!
}

input EditedUser {
    id: Guid!
    nickname: String
    bio: String
}

input NewPhoto {
    userId: Guid!
    photo: String!
}

input NewPost {
    photo: String!
}

input NewReaction {
    postId: Guid!
    type: ReactionType!
}

input NewPostReport {
    postId: Guid!
    reportType: ReportType!
}

input NewUserReport {
    accusedUserId: Guid!
    reportType: ReportType!
}

query {
    user(userId: Guid): User!
    post(postId: Guid!): Post!
    reactedPosts(pagedArray: NewPagedArray!, reactionType: ReactionType): Posts!
    nextPost: Post!
    postReports(pagedArray: NewPagedArray!, postId: Guid): PostReports!
    userReports(pagedArray: NewPagedArray!, userId: Guid): UserReports!
}

mutation {
    requestCode(phoneNumber: String!): Guid!
    verifyCode(sessionId: Guid!, code: String!): Session!
    refreshSession: Session!
    logout: String!
    
    registerUser(user: NewUser!): User!
    editUser(user: EditedUser!): String!
    deleteUser(userId: Guid!): String!
    
    setUserPhoto(photo: NewPhoto!): String!
    deleteUserPhoto(userId: Guid!): String!
    
    createPost(post: NewPost!): Post!
    deletePost(postId: Guid!): String!
    
    createReaction(reaction: NewReaction!): String!
    deleteReaction(reactionId: Guid!): String!
    
    createPostReport(postReport: NewPostReport!): PostReport!
    deletePostReport(postReportId: Guid!): String!
    
    createUserReport(userReport: NewUserReport!): UserReport!
    deleteUserReport(userReportId: Guid!): String!
}
```