Introduction to Neogma
mainNeogma is a fully type-safe Object-Graph-Mapping (OGM) framework designed for Neo4j and TypeScript. It allows developers to define graph models using decorators, manage complex relationships automatically, and build queries using a fluent API while maintaining complete type safety through automatic type inference.
Key capabilities include:
- Decorator-based models: Define nodes, properties, and relationships using
@Node,@Property, and@Relationship. - Type-safe validation: Uses TypeBox for powerful schema validation (e.g., unions, patterns, constraints).
- Eager loading: Load nested relationships in a single query to prevent N+1 performance issues.
- Parameterized queries: Protects against injection attacks by passing all user input as parameters.
- NestJS integration: Native support via the
@neogma/nestmodule.