Documentation / @warp-drive/utilities / json-api / serializeResources
Function: serializeResources()
Call Signature
function serializeResources(cache, identifiers): object;
Defined in: -private/json-api/serialize.ts:40
⚠️ This util often won't produce the necessary body for a {json:api} request
While this may come as a surprise, they are intended to serialize cache state for more generalized usage. {json:api} has a large variance in acceptable shapes, and only your app can ensure that the body is correctly formatted and contains all necessary data.
Serializes the current state of a resource or array of resources for use with POST or PUT requests.
Parameters
cache
identifiers
Returns
object
An object with a data
property containing the serialized resource patch
data
data: ResourceObject;
Call Signature
function serializeResources(cache, identifiers): object;
Defined in: -private/json-api/serialize.ts:41
⚠️ This util often won't produce the necessary body for a {json:api} request
While this may come as a surprise, they are intended to serialize cache state for more generalized usage. {json:api} has a large variance in acceptable shapes, and only your app can ensure that the body is correctly formatted and contains all necessary data.
Serializes the current state of a resource or array of resources for use with POST or PUT requests.
Parameters
cache
identifiers
Returns
object
An object with a data
property containing the serialized resource patch
data
data: ResourceObject[];