create_rendering

mutationSince v1.0

Create a rendering — the page template for one node or relationship type. Every element of that type is presented through it, so you write the shape of the page once rather than writing each page.

The document is Markdown with two additions: interpolations that drop in values from the element the page is about, and blocks that pull in related elements, properties, metrics or diagrams. A type can have several renderings — a full one for the website, a short one for a board report — and each publication picks the one it wants.

After writing a document, run preview_rendering against a real element. A block that quietly matches nothing renders as nothing, and the document itself gives no hint that anything is wrong. See the help article "Writing Rendering Documents" for the full vocabulary.

Parameters

NameTypeRequiredDefaultDescription
nameStringName for the rendering. Pick one you'll recognise later — 'Service page', 'Board summary' — since publications choose renderings by name.
descriptionStringOptional note for whoever maintains the rendering. Not shown to readers.
folder_idStringFolder to place the new rendering in, by ID or name.
documentStringThe page template: Markdown, plus interpolations like {{ subject.label }} that drop in values from the element the page is about, plus blocks starting with ::: that pull in properties, related elements, metrics or diagrams. An optional query block at the top declares which related elements a view block can draw on. Two things catch people out. Type and relationship names must be spelled exactly as they are in your model — a name that doesn't exist matches nothing, silently. And a heading you write as prose prints on every page even when the block below it finds nothing, so put the heading on the block instead. See the help article "Writing Rendering Documents" for the full vocabulary, and preview_rendering to check what a document actually produces.
target_typeStringThe node or relationship type this rendering presents, by id or name. Every element of that type is rendered through it.

Example Request

{"name": "Service page", "target_type": "Service", "document": "# {{ subject.label }}\n\n:::prose{ source=subject.description }\n\n:::properties"}

Example Response

{"success": true, "operation_count": 1, "versions": [92], "created": [{"kind": "rendering", "id": "4e2a...", "label": "Service page"}]}

This content was written collaboratively with AI.