https://github.com/007tickooayush/express-grql
Nodejs GraphQL project using MERN stack demonstrating the alernatives to REST API, with each REST and GraphQL type request handling projects
https://github.com/007tickooayush/express-grql
Last synced: about 2 months ago
JSON representation
Nodejs GraphQL project using MERN stack demonstrating the alernatives to REST API, with each REST and GraphQL type request handling projects
- Host: GitHub
- URL: https://github.com/007tickooayush/express-grql
- Owner: 007tickooayush
- Created: 2024-01-19T15:48:32.000Z (over 1 year ago)
- Default Branch: GrQL
- Last Pushed: 2024-01-29T17:11:43.000Z (over 1 year ago)
- Last Synced: 2025-02-01T01:36:56.686Z (4 months ago)
- Language: TypeScript
- Size: 123 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node.js GraphQL Project
This project demonstrates the alternatives to REST API by implementing both REST and GraphQL type request handling projects using the MERN stack.
## Description
This project showcases the usage of GraphQL alongside the traditional REST API approach. It provides examples of how to handle different types of requests using both REST and GraphQL.## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)## Installation
Follow these steps to install and set up the project:1. Clone the repository.
2. Navigate to the project directory.
3. Run `bun install` or `npm install` to install the dependencies.
4. Set up the required environment variables.
5. Run `bun run start` script or `npm start` to start the server.## Usage
To use the project, follow these instructions:1. Make requests to the REST API endpoints to interact with the RESTful part of the project.
2. Make requests to the GraphQL endpoint to interact with the GraphQL part of the project.
3. Refer to the project documentation for detailed information on the available endpoints and request formats.- ### GraphQL Client read example:
```
query {
clients{
name
}
}
```- ### GraphQL Client insert example:
```
mutation{
addClient(name: "Ayush Tickoo", email: "[email protected]", phone: "9914188982") {
name,
phone,
id
}
}
```- ### GraphQL examples:
```
mutation{
addClient(name: "Mike Wazowski", email:"[email protected]", phone:"6969696970"){
id
}
}mutation{
addProject(
name:"ScreamMeasure",
description:"Measuring the sound intensity of a scream",
status: progress,
clientId:"65aca787046afcc1687ae5b8"
){
id,
name
}
}mutation{
updateProject(
id : "65acaad61232c850ab791d3c"
status: completed
) {
name
status
}
}query{
projects{
id
name
status
client{
name
}
}
}query{
clients {
id
name
}
}query{
client(id:"65aaaea49f2831bd71bc304d"){
name
}
}
```## Contributing
Contributions are welcome! If you would like to contribute to this project, please follow these steps:1. Fork the repository.
2. Create a new branch for your feature or bug fix.
3. Make your changes and commit them.
4. Push your changes to your forked repository.
5. Submit a pull request to the main repository.