Skip to main content
Version: v10.0.0

IsResourceValid

Whether every derived loader and mutation reads rows that fit the collection


Import
import { IsResourceValid } from "@hyper-fetch/db"

Preview​

type IsResourceValid<Row,KeyField,Node,Item,Mapped,ListGiven,InsertSuccess,UpdateSuccess> = [(ListGiven extends true ? IsExactRow<Inferred<Mapped, DefaultRows<ListRequest<Node>>>, Row> : true), (ItemNode<Node, Item> extends { $get: infer Req } ? IsExactRow<DefaultRows<Req>, Row> : true), (Node extends { $post: infer Req } ? (unknown extends InsertSuccess ? IsExactRow<ExtractResponseType<Req>, Row> : true) : true), ([UpdateRequestOf<Node, Item>] extends [never] ? true : (unknown extends UpdateSuccess ? IsPartialRow<ExtractResponseType<UpdateRequestOf<Node, Item>>, Row, KeyField> : true))] extends [true, true, true, true] ? true : false;