LayoutBuilderUsageCount
One builder, and how many of this product's assets reference the node from it.
A TYPED PAIR RATHER THAN A JSON! MAP, for two reasons that both bit before it was one.
A map has to spell the builder as a string key, and the only spelling the server has to hand is
the PHP enum's case name — which made LayoutBuilderType's PHP case names part of the wire
contract, while the sibling builders was serialised through the SCHEMA enum of the same name
declared at the top of this file. Two independent spellings of the same four names, bound to each
other by nothing (@enum(value: N) binds a member to the int, not to the case name), and the
consumer indexes one with values from the other. A rename on either side would have dropped every
count, with no error in either language.
And JSON in this schema serialises to a STRING, not to an object, so indexing the field directly
yielded undefined for every builder. That one was not hypothetical — it shipped and was found by
reading a live response.
A typed list has neither problem: the builder travels as the schema enum, and the shape is checked.
type LayoutBuilderUsageCount {
builder: LayoutBuilderType!
count: Int!
}
Fields
LayoutBuilderUsageCount.builder ● LayoutBuilderType! non-null enum
LayoutBuilderUsageCount.count ● Int! non-null scalar
Member Of
LayoutLibraryItemUsage object


