Skip to content

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…QueryReturns
a runner in a raceRunner.silkthe silk this runner carries on the card
an ownerOwner.silksthe owner’s reusable registered silks
a horseHorse.silkHistory or the top-level horseSilkHistorysilks the horse has worn across its career

Silk data is in the standard schema — no editorial key required.


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" }
Open in Playground →

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" }
Open in Playground →

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 a Horse in the selection set (e.g. via the entity query, or race.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" }
Open in Playground →