LayoutLibraryNodeSource
What the BUILDER needs about a referenced Library node: the facts libraryLinkState() decides the
padlock from, and the body itself.
ONE LOOKUP FOR THREE CONSUMERS, deliberately. The padlock reads the flags, the canvas island renders
properties, and detach() materialises from the same properties — so the thing an author sees and
the thing detaching produces cannot disagree, which is what detach always claimed and could not
guarantee while it read a dependency nobody populated.
NONE OF IT IS ON A PUBLISHED PAYLOAD, and does not need to be. Every published render flattens its
references server-side, so no published surface ever meets a LIBRARY_REF. This query is
@guard-ed, which is fine for exactly that reason — unlike the Drop Down options fallback, which was
guarded AND relied on by published forms until #7389 found it.
A block that has been DETACHED still queries this for its padlock state, and pulls a properties it
will not render. One body, on a builder request, to keep a single hook serving every case.
type LayoutLibraryNodeSource {
uuid: String!
name: String!
folder_path: [String!]!
is_paminga: Boolean!
reference_only: Boolean!
deleted: Boolean!
compatible_with: [LayoutBuilderType!]!
properties: JSON!
properties_for_copy: JSON!
schema_version: Int!
}
Fields
LayoutLibraryNodeSource.uuid ● String! non-null scalar
LayoutLibraryNodeSource.name ● String! non-null scalar
LayoutLibraryNodeSource.folder_path ● [String!]! non-null scalar
The folders this node sits in, outermost first, WITHOUT the node's own name.
So the edit panel can say where a linked block came from instead of only which shelf it is on. Empty when the node sits at the root of its tree.
NAMES, NOT A JOINED PATH, and no root label: the client already owns how a shelf is written
(FileManager/types.ts maps PRODUCT to "My Library"), so sending a prefix here would be a second
place that decides it — and the two would drift the first time either was reworded.
LayoutLibraryNodeSource.is_paminga ● Boolean! non-null scalar
Paminga-authored. Global blocks are always copies, so they can never be re-linked.
LayoutLibraryNodeSource.reference_only ● Boolean! non-null scalar
Governed: the copy path is withheld, so a placed instance cannot be unlocked.
LayoutLibraryNodeSource.deleted ● Boolean! non-null scalar
Soft-deleted. Existing references keep rendering; nothing new may link to it.
LayoutLibraryNodeSource.compatible_with ● [LayoutBuilderType!]! non-null enum
Builders the source is still valid in — it may have narrowed since a copy was taken.
LayoutLibraryNodeSource.properties ● JSON! non-null scalar
The node's stored body, RAW — what the canvas island DRAWS. A reference renders the node as it is.
LayoutLibraryNodeSource.properties_for_copy ● JSON! non-null scalar
The same body with every token marked for cloning — what detach() materialises.
BOTH SHAPES FROM ONE LOOKUP, because they answer different questions about the same node and detach
has to produce exactly the block the author is looking at. Drawing wants the node's own tokens;
copying must not share them — a detached copy still pointing at the NODE's token_usages breaks
when the node is edited or its usages are re-owned.
Not served by layoutLibraryNodeForValueInsert, which returns this shape but refuses a TRASHED
node: detaching is not taking a new copy, it is rescuing a use that already exists, and a reference
to a soft-deleted node is exactly where that matters.
LayoutLibraryNodeSource.schema_version ● Int! non-null scalar
Returned By
layoutLibraryNodeSource query


