Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dharejo-junaid/graphql
This repository contains code for a GraphQL API implemented with Apollo Server, powered by an Express.js web server. It includes a MongoDB database connection for data storage. The codebase is organized for easy understanding and integration into projects requiring emoji-related functionalities.
https://github.com/dharejo-junaid/graphql
express graphql mongodb mongoose nodejs
Last synced: 13 days ago
JSON representation
This repository contains code for a GraphQL API implemented with Apollo Server, powered by an Express.js web server. It includes a MongoDB database connection for data storage. The codebase is organized for easy understanding and integration into projects requiring emoji-related functionalities.
- Host: GitHub
- URL: https://github.com/dharejo-junaid/graphql
- Owner: Dharejo-Junaid
- Created: 2023-10-11T03:57:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-12T15:38:09.000Z (over 1 year ago)
- Last Synced: 2024-11-24T16:17:16.529Z (2 months ago)
- Topics: express, graphql, mongodb, mongoose, nodejs
- Language: JavaScript
- Homepage:
- Size: 77.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Emoji API with GraphQL, Express, and MongoDB
This project provides a GraphQL API for managing emojis using Express and MongoDB. It includes resolvers, type definitions, and a server setup for handling GraphQL requests.
## Getting Started
You don't need to insert emojis into your database. When you run this project first time. It will insert all the emojis for you. So you just follow these instructions to set up and run the project on your local machine.
### Prerequisites
- Node.js and npm installed on your system
- MongoDB installed locally or a cloud-based MongoDB service### Installation
1. Clone the repository to your local machine:
```bash
git clone https://github.com/Dharejo-Junaid/emojis
```2. Install dependencies using npm:
```bash
npm install
```3. Start server on port 5000 using:
```bash
npm start
```4. open your browser and type:
```bash
http://localhost:5000/graphql
```## API Endpoints
### Queries:
1. getEmojis: Retrieve emojis based on a provided filter.
2. getEmojiById: Retrieve an emoji by its ID
3. getRandomEmoji: Retrieve a random emoji.## Mutations:
1. addEmoji: Add a new emoji to the database.
2. updateEmoji: Update an existing emoji.
3. deleteEmoji: Delete an emoji by its ID.