https://github.com/hsnice16/interview-experience-backend
Backend for Interview Experience using Node.js, GraphQL, and PostgreSQL
https://github.com/hsnice16/interview-experience-backend
apollo apollo-server graphql graphql-server node-postgres nodejs pg postgresql ts-node-dev typescript
Last synced: 3 months ago
JSON representation
Backend for Interview Experience using Node.js, GraphQL, and PostgreSQL
- Host: GitHub
- URL: https://github.com/hsnice16/interview-experience-backend
- Owner: hsnice16
- Created: 2023-10-14T14:02:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-03T05:18:08.000Z (over 1 year ago)
- Last Synced: 2025-02-01T07:31:53.128Z (12 months ago)
- Topics: apollo, apollo-server, graphql, graphql-server, node-postgres, nodejs, pg, postgresql, ts-node-dev, typescript
- Language: TypeScript
- Homepage: https://interview-experience-backend.onrender.com/
- Size: 63.5 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README

# ✨ Interview Experience Backend
Backend for Interview Experience





---
## 👀 Query
1. Get all the blogs.
```graphql
query Query {
blogs {
_id
author {
name
profile
}
forOrganization
link
title
}
}
```
2. Get all the blogs for an organization.
```graphql
query Query($filter: BlogFilter) {
blogs(filter: $filter) {
author {
name
profile
}
_id
forOrganization
link
title
}
}
{
"filter": {
"forOrganization": "Google"
}
}
```
3. Get paginated blogs.
```graphql
query Query($limit: Int!, $offset: Int!) {
blogs(limit: $limit, offset: $offset) {
author {
name
profile
}
_id
forOrganization
link
title
}
}
{
"limit": 4,
"offset": 2
}
```
4. Get all the organizations.
```graphql
query Query {
organizations {
_id
blogCount
name
}
}
```
5. Get paginated organizations.
```graphql
query Query($offset: Int!, $limit: Int!) {
organizations(offset: $offset, limit: $limit) {
_id
blogCount
name
}
}
{
"limit": 4,
"offset": 2
}
```
6. Get staging blogs.
```graphql
query Query($status: String!) {
stagingBlogs(status: $status) {
_id
author {
name
profile
}
forOrganization
status
link
title
}
}
{
"status": "pending"
}
```
---
## 🏗️ Mutation
1. Create a new blog.
```graphql
mutation Mutation(
$title: String!
$link: String!
$forOrganization: String!
$author: NewAuthor!
) {
createBlog(
title: $title
link: $link
forOrganization: $forOrganization
author: $author
) {
_id
status
author {
name
profile
}
forOrganization
link
title
}
}
{
"title": "blog-title",
"link": "blog-link",
"forOrganization": "blog-forOrganization",
"author": {
"name": "author-name",
"profile": "author-profile"
}
}
```
2. Update the new blog status.
```graphql
mutation Mutation($id: ID!, $status: String!) {
updateBlogStatus(_id: $id, status: $status) {
_id
author {
name
profile
}
forOrganization
link
status
title
}
}
{
"id": "new_blog_000",
"status": "rejected"
}
```
---
## 🔌 Getting Started
1. Clone the repository on your local machine with the command below in your terminal, and cd into the **interview-experience-backend** folder.
```shell
git clone https://github.com/hsnice16/interview-experience-backend.git
cd interview-experience-backend
```
2. Install dependencies (if you are using **yarn** then do with that).
```shell
npm install
```
3. Start the development server.
```shell
npm run watch
```