GraphQL

Interfaces & Types

Each Video Picker field adds a {fieldHandle}_Video object type to Craft’s GraphQL schema, named from the field’s handle. Queries shows complete requests and responses.

Field Value Types

The {fieldHandle}_Video Type

The selected video in a Video Picker field. For a field with the handle videoPickerField, the type is videoPickerField_Video. All fields are nullable, and which ones have values depends on the provider and the stored video.

authorName

The name of the video’s author or channel.

authorUrl

The URL of the author’s profile or channel.

authorUsername

The author’s username on the provider’s platform.

date

The date the video was published or created.

description

The video’s description.

duration

The video’s length in seconds.

embedHtml

The iframe HTML for the video, using the field’s embed defaults.

embedUrl

The embed URL for the video, using the field’s embed defaults.

formattedDuration

The video’s length for display, as mm:ss or hh:mm:ss. A live stream reports ∞.

height

The video’s height in pixels, when the provider reports it.

id

The video’s ID on the provider’s platform.

plays

The number of times the video has been played, when the provider reports it. It’s a Float so counts above the 32-bit integer limit are returned correctly.

private

Whether the provider marks the video as private.

sourceHandle

The handle of the Video Picker source the video came from.

thumbnails

A list of thumbnail images as JSON, each with a url and optional width and height.

title

The video’s title.

url

The video’s URL on the provider’s platform.

width

The video’s width in pixels, when the provider reports it.

Scalars

The ArrayType Scalar

ArrayType is a JSON scalar used by thumbnails. Request the field name on its own, without a nested selection, and your client receives the thumbnails as structured data.

{
  "thumbnails": [
    { "url": "https://i.ytimg.com/vi/jfKfPfyJRdk/mqdefault_live.jpg", "width": 320, "height": 180 }
  ]
}