Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chuksjoshuaa/reddit-project
Built a Full stack Typescript project with GraphQL, PostgreSQL, Typeorm, Chakra UI, Redis and so much more. Users can Login and Register to access the full functionalities of the website. Users can upvote and downvote a particular post. Check it out!
https://github.com/chuksjoshuaa/reddit-project
apollo-server-express chakra-ui graphql mikro-orm nextjs nodejs postgresql typeorm typescript urql
Last synced: 2 days ago
JSON representation
Built a Full stack Typescript project with GraphQL, PostgreSQL, Typeorm, Chakra UI, Redis and so much more. Users can Login and Register to access the full functionalities of the website. Users can upvote and downvote a particular post. Check it out!
- Host: GitHub
- URL: https://github.com/chuksjoshuaa/reddit-project
- Owner: ChuksJoshuaa
- Created: 2022-11-13T15:37:40.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-29T04:34:28.000Z (10 months ago)
- Last Synced: 2024-04-16T14:14:12.285Z (7 months ago)
- Topics: apollo-server-express, chakra-ui, graphql, mikro-orm, nextjs, nodejs, postgresql, typeorm, typescript, urql
- Language: TypeScript
- Homepage: https://client-reddit.vercel.app/
- Size: 1.12 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Reddit Full Stack Typescript Application
.
## GraphQL Queries & Mutations## Queries
### Get all posts
```
query Posts($limit: Int!, $cursor: String) {
posts(cursor: $cursor, limit: $limit) {
hasMore
posts {
id
title
points
descriptionSnippet
createdAt
updatedAt
voteStatus
author {
id
username
}
}
}
}```
### Get a single post
```
query Post($id: Int!) {
post(id: $id) {
id
title
description
authorId
points
createdAt
updatedAt
}
}```
### Get user
```
query Me {
me {
id
username
}
}```
##Mutations
### Create a new post
```
mutation CreatePost($input: PostInput!) {
createPost(input: $input) {
id
title
description
authorId
points
createdAt
updatedAt
}
}```
### Update a post
```
mutation UpdatePost(
$id: Int!
$authorId: Int!
$title: String!
$description: String!
) {
updatePost(
id: $id
authorId: $authorId
title: $title
description: $description
) {
id
title
description
descriptionSnippet
}
}```
### Delete Post
```
mutation DeletePost($id: Int!, $authorId: Int!) {
deletePost(id: $id, authorId: $authorId)
}```
### Login
```
mutation Login($email: String!, $password: String!) {
login(email: $email, password: $password) {
errors {
field
message
}
user{
id
username
createdAt
}
}
}```
### Register
```
mutation Register($email: String!, $username: String!, $password: String!) {
register(
options: { email: $email, username: $username, password: $password }
) {
errors {
field
message
}
user{
id
username
}
}
}```
### Logout
```
mutation Logout {
logout
}```
### vote
```
mutation Vote($value: Int!, $postId: Int!) {
vote(value: $value, postId: $postId)
}```
### Forgot Password
```
mutation ForgotPassword($email: String!) {
forgotPassword(email: $email)
}```
### Change Password
```
mutation ChangePassword($token: String!, $newPassword: String!) {
changePassword(token: $token, newPassword: $newPassword) {
errors {
field
message
}
user{
id
username
}
}
}```