MediaItem
ObjectRepresents uploaded media, including images, videos, documents, and audio files.
Fields
Alternative text to display when resource is not displayed
Returns ancestors of the node. Default ordered as lowest (closest to the child) to highest (closest to the root).
The caption for the resource
Connection between the HierarchicalContentNode type and the ContentNode type
The number of comments. Even though WPGraphQL denotes this field as an integer, in WordPress this field should be saved as a numeric string for compatibility.
Whether the comments are open or closed for this particular post.
CSS classes WordPress applies to the post-content wrapper based on the template layout attribute and theme.json settings.
Connection between the ContentNode type and the ContentType type
The name of the Content Type the node belongs to
The unique identifier stored in the database
Post publishing date.
The publishing date set in GMT.
Description of the image (stored as post_content)
The desired slug of the post
If a user has edited the node within the past 15 seconds, this will return the user that last edited. Null if the edit lock doesn't exist or is greater than 15 seconds
The RSS enclosure for the object
Connection between the ContentNode type and the EnqueuedScript type
Connection between the ContentNode type and the EnqueuedStylesheet type
The filename of the mediaItem for the specified size (default size is full)
The path to the original file relative to the uploads directory
The filesize in bytes of the resource
The global unique identifier for this post. This currently matches the value stored in WP_Post->guid and the guid column in the "post_objects" database table.
Whether the attachment object is password protected.
The globally unique identifier of the attachment object.
Whether the node is a Comment
Whether the node is a Content Node
Whether the node represents the front page.
Whether the node represents the blog page.
Whether the object is a node in the preview state
Whether the object is restricted from the current viewer
Whether the node is a Term
The user that most recently edited the node
The permalink of the post
Details about the mediaItem
The id field matches the WP_Post->ID field.
Url of the mediaItem
Type of resource
The mime type of the mediaItem
The local modified time for a post. If a post was recently updated the modified field will change to match the corresponding time.
The GMT modified time for a post. If a post was recently updated the modified field will change to match the corresponding time in GMT.
The parent of the node. The parent object can be of various types
Database id of the parent node
The globally unique identifier of the parent node.
The password for the attachment object.
The database id of the preview node
Whether the object is a node in the preview state
The Yoast SEO data of the ContentNode
The sizes attribute value for an image.
The uri slug for the post. This is equivalent to the WP_Post->post_name field and the post_name column in the database for the "post_objects" table.
Url of the mediaItem
The srcset attribute specifies the URL of the image to use in different situations. It is a comma separated string of urls and their widths.
The current status of the object
The template assigned to a node of content
The title of the post. This is currently just the raw title. An amendment to support rendered title needs to be made.
The unique resource identifier path
Connection between the MediaItem type and the Comment type