data-client-schema
Installation
SKILL.md
1. Defining Schemas
Compose schemas to match the JSON an endpoint returns. Import them from the protocol package
the app uses (@data-client/rest, @data-client/graphql or @data-client/endpoint; both protocol packages re-export
endpoint). For GraphQL, extend GQLEntity instead of Entity; it declares the id field used as pk().
Object
- Entity - represents a single unique object (denormalized)
- EntityMixin - turn any pre-existing class into an Entity
- new Union(Entity) - polymorphic objects (A | B)
{[key:string]: Schema}- immutable objects- new Invalidate(Entity|Union) - to delete an Entity
- new Lazy(() => Schema) - break circular imports / defer deep recursive denormalization