Skip to content

Documentation / @warp-drive/utilities / handlers / MetaDocHandler

Variable: MetaDocHandler

ts
const MetaDocHandler: Handler;

Defined in: -private/handlers/meta-doc.ts:50

MetaDocHandler processes requests that are marked as meta requests.

It treats the response body as "entirely meta" transforming

ts
{
  some: "key",
  another: "thing"
}

into

ts
{
	 meta: {
    some: "key",
    another: "thing"
  }
}

To activate this handler, a request should specify

ts
options.isMetaRequest = true

For instance

ts
store.request({
  url: '/example',
  options: {
    isMetaRequest: true
  }
});

Errors are not processed by this handler, so if the request fails and the error response is not in {JSON:API} format additional processing may be needed.

Released under the MIT License.