Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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!

Awesome Lists containing this project

README

        

# Reddit Full Stack Typescript Application

icon.
## 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
email
}
}
}
}

```

### 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
email
createdAt
}
}
}

```

### Register

```
mutation Register($email: String!, $username: String!, $password: String!) {
register(
options: { email: $email, username: $username, password: $password }
) {
errors {
field
message
}
user{
id
username
email
}
}
}

```

### 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
email
}
}
}

```