@morphql/server
v0.1.38
Published
MorphQL Server Core - Headless transformation engine
Readme
@morphql/server
A headless transformation server core for MorphQL. Designed to be embedded into existing NestJS or Node.js applications to provide managed transformation endpoints with caching and OpenAPI support.
Core Features
- 🏗️ Headless Core: Embed MorphQL management into your own backend.
- 🔗 Staged Queries: Map
.morphqlfiles to named API endpoints automatically. - ⚡ Redis Integration: Strategic caching of compiled queries for maximum throughput.
- 📖 Auto-OpenAPI: Generates Swagger/OpenAPI fragments for all defined transformations.
- 🛡️ Type-Safe: Inferred schemas for request and response formats.
Installation
npm install @morphql/server @morphql/coreBasic Usage (NestJS/Node)
import { MorphServer } from '@morphql/server';
const morph = new MorphServer({
queriesDir: './queries', // automatically load .morphql files
cache: redisCache, // optional Redis caching
});
await morph.initialize();
// Execute a named staged query
const result = await morph.executeStaged('user-profile', sourceData);Standalone Usage
If you need a ready-to-deploy microservice, check the Server Instance Starter Template in our repository. It includes:
- Docker & Docker Compose setup
- Pre-configured NestJS application
- Health checks (Liveness/Readiness)
- API Key authentication
Learn More
License
MIT
