YABGSMS

Welcome to YABGSMS

Get started using Yet Another Basic GraphQL Social Media Server

Get Started!

Welcome to the docs! YABGSMS is a simple GraphQL server that allows you to create, read, update, and delete posts and users. It is built using Fumadocs and GraphQL / ApolloServer.

You can play around with the server using the GraphQL Client on the Cloudflare Worker. Some endpoints require an admin token, which is just the header Authorization: secret for now (just a basic placeholder for showcase purposes)

The server is divided in two simple parts: Posts and Users. You can create, read, update, and delete both of them.

Schema

Below is the entire schema for the server. You can use this to understand how the server works, and how to interact with it.

type User {
  id: Int!
  username: String!
  fullName: String!
}
 
type Post {
  id: Int!
  author: Int!
  title: String!
  content: PostContent!
}
 
type PostContent {
  type: PostContentType!
  data: String!
}
 
enum PostContentType {
  IMAGE,
  TEXT
}
 
type Query {
  users: [User]
  posts: [Post]
  post(id: Int!): Post
  user(id: Int!): User
}
 
type Mutation {
  createUser(username: String!, fullName: String!): User
  deleteUser(id: Int!): Boolean!
  updateUserName(id: Int!, username: String!): User
  updateUserFullName(id: Int!, fullName: String!): User
 
  createPost(author: Int!, title: String!, contentType: PostContentType!, content: String!): Post
  deletePost(id: Int!): Boolean!
  updatePostTitle(id: Int!, title: String!): Post
  updatePostContent(id: Int!, contentType: PostContentType!, content: String!): Post
}

On this page