Querying silks
A silk is the colours-and-pattern a horse carries in a race (the owner’s registered racing colours). The API exposes silks three ways, each suited to a different surface:
| You have… | Query | Returns |
|---|---|---|
| a runner in a race | Runner.silk | the silk this runner carries on the card |
| an owner | Owner.silks | the owner’s reusable registered silks |
| a horse | Horse.silkHistory or the top-level horseSilkHistory | silks the horse has worn across its career |
Silk data is in the standard schema — no editorial key required.
1. The silk a runner carries
Section titled “1. The silk a runner carries”Select silk on any Runner. The lightweight Silk gives you description, imageUrl, status, and assignmentType; the nested SilkDefinition carries the structured colour/pattern breakdown for clients that render their own silk rather than using the image.
query RunnerSilks($raceId: ID!) { race(id: $raceId) { id runners { id cloth horse { name } silk { description imageUrl status assignmentType definition { primaryColor secondaryColor tertiaryColor bodyPattern sleevePattern capColor capPattern invalid unknowns } } } }}Variables
{ "raceId": "race_abc123" }2. An owner’s reusable silks
Section titled “2. An owner’s reusable silks”Owner.silks returns the owner’s registered colours from prior runs, each with isDefault and the firstSeenAt / lastSeenAt window. Use this to show “this owner’s colours” independently of any single race. Reach the owner through the polymorphic entity query and select silks in an ... on Owner fragment.
query OwnerSilks($ownerId: ID!) { entity(entityType: OWNER, id: $ownerId) { id name ... on Owner { silks { isDefault firstSeenAt lastSeenAt silk { description imageUrl primaryColor bodyPattern capColor capPattern } } } }}Variables
{ "ownerId": "owner_abc123" }3. A horse’s silk history
Section titled “3. A horse’s silk history”A horse can carry different silks over its career (ownership changes, second colours). Two shapes return the same data, most recent first, deduplicated by silk definition — pick whichever fits your traversal:
Horse.silkHistory(limit)— when you already have aHorsein the selection set (e.g. via theentityquery, orrace.runners[].horse).horseSilkHistory(horseId, limit)— a top-level query when you only have the horse id.
query HorseSilks($horseId: ID!) { # Field on the Horse type, reached via the polymorphic entity query entity(entityType: HORSE, id: $horseId) { id name ... on Horse { silkHistory(limit: 10) { raceDate raceName courseName silk { description imageUrl primaryColor bodyPattern } } } }
# Equivalent top-level query horseSilkHistory(horseId: $horseId, limit: 10) { raceDate raceName courseName silk { description imageUrl } }}Variables
{ "horseId": "horse_abc123" }