Skip to content

amantyagi22/graphite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Minimal GraphQL Engine in Node.js — Built from Scratch

This project is a learning-first implementation of a GraphQL-like query system using plain JavaScript.

No external libraries, no GraphQL packages — just raw recursion and logic to understand how GraphQL really works under the hood.


🔍 Features

  • Supports nested queries like:
{ user { name posts { title } } }
  • Returns clean, structured responses:
{
  "user": {
    "name": "John Doe",
    "posts": [
      { "title": "My First Post" },
      { "title": "Second Post" }
    ]
  }
}
  • No overfetching — returns only what's requested

  • Built with Express.js for easy testing via a /graphql POST endpoint

🛠️ Tech Stack

  • Node.js

  • Express

  • Pure JavaScript (no GraphQL libraries)

📁 Structure

  • utils.js: Contains the core parser and resolver logic

  • server.js: Express server with /graphql endpoint

🚀 Getting Started

git clone https://github.com/yourusername/graphql-from-scratch
cd graphql-from-scratch
npm install
node server.js

Make a POST request:

POST /graphql
{
  "query": "{ user { name posts { title } } }"
}

🛣️ Roadmap

  • ✅ Nested querying

  • 🔜 Multiple root queries

  • 🔜 Schema validation

  • 🔜 Variable & fragment support

📚 Why This?

Inspired by curiosity. GraphQL is powerful — but even more so when you understand how it works internally.

🧑‍💻 Author

Aman Tyagi — LinkedIn

About

A minimal, learning-focused GraphQL engine built from scratch in Node.js, using only Express and pure JavaScript. No external GraphQL libraries—just core parsing and resolving logic to handle nested queries at a /graphql endpoint. Ideal for understanding how GraphQL works under the hood.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors