Skip to content

GraphQL Types

Any Mux data available in the Antlers tags can also be queried via GraphQL.

Example

Assuming you've added a mirror field called mux to your default asset container blueprint, you can query Mux data from the existing fieldname at mux. In your frontend, you can plug the returned data into one of the official Mux video components.

graphql
{
  asset: asset(id: "assets::video.mp4") {
    path
    ... on Asset_Assets {
      mux {
        playback_id
        thumbnail
      }
    }
  }
}
json
{
  "data": {
    "asset": {
      "id": "assets::video.mp4",
      "path": "video.mp4",
      "mux": {
        "playback_id": "02G1uw5SpNCrPMwiqfyNY4RkOWff4O7DCohToTqcZXH8",
        "thumbnail": "https://image.mux.com/02G1uw5SpNCrPMwiqfyNY4RkOWff4O7DCohToTqcZXH8/thumbnail.jpg",
      }
    }
  }
}
html
<mux-video
  :playback-id="mux.playback_id"
  :poster="mux.thumbnail"
  width="1920"
  height="1080"
></mux-video>

Available subfields

FieldTypeDescription
mux_idstringMux asset id
playback_idMuxPlaybackIdPlayback id used for streaming, defaults to public
playback_idsMuxPlaybackId[]All available playback ids for this asset in case multiple exist
playback_urlstringPlayback url used for streaming
playback_tokenstringSigned playback token used for secure streaming
thumbnailstringThumbnail image url
gifstringAnimated gif url
placeholderstringSmall blurry placeholder image data uri

Unlicensed commercial plugin