Skip to content
qino

Since 0.1.0

getEntry

Read the item's file.

Reads the item's file, validates it, and applies the selected view.

src/app/page.tsx
const home = await homeItem.getEntry();
home.title;
home["featured-posts"][0].title; // resolved by the default view
home._meta.fileName; // "home.md"

Signature

@qino/cms
item.getEntry(options?: { view?: ViewName }): Promise<Entry>;

Parameters

NameTypeRequiredDefaultDescription
options.viewview nameno"default"A view declared in views

Returns

Promise<Entry>: the schema output, _meta (fileName, filePath, no slug), resolved relations at the view's depth, and the awaited augment output.

Throws

  • A raw ENOENT error from Node when the file does not exist.
  • Unknown view "<name>". Available views: <names>.
  • Getter option errors, validation, relation, and augment errors. See Errors.