JS Client for Graphiti, a JSON:API-compliant ORM similar to ActiveRecord. v0.10.24 is current. Supports TypeScript and plain JavaScript, isomorphic (browser + Node.js). Key differentiators: decorator-based model definitions, fluent query builder, includes/pagination/sorting. Actively maintained with regular releases.
npm install spraypaintNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates defining models with decorators, configuring base URL, and using chained query methods.
Add @Model() decorator to all model classes extending SpraypaintBase.
Replace @Attribute() with @Attr().
Add 'import "reflect-metadata"' at the top of your main file.
Declare attributes with '!' as in '@Attr() firstName!: string'
Define static jsonapiType = 'your-type-string' in each model.
Set static baseUrl and static apiNamespace on the ApplicationRecord or each model.
Ensure import { SpraypaintBase } from 'spraypaint' is correct and reflect-metadata is imported before usage.Run 'npm install reflect-metadata' and add import 'reflect-metadata' at the top of your entry file.
Add the @Model() decorator to the model class definition.
Add 'static jsonapiType = 'your-type-name'' to the model.