Schema Documentation

contentNode

Description

A node used to manage content

Response

Returns a ContentNode

Arguments
NameDescription
id - ID! Unique identifier for the content node.
idType - ContentNodeIdTypeEnum Type of unique identifier to fetch a content node by. Default is Global ID
contentType - ContentTypeEnum The content type the node is used for. Required when idType is set to "name" or "slug"
asPreview - Boolean Whether to return the Preview Node instead of the Published Node. When the ID of a Node is provided along with asPreview being set to true, the preview node with un-published changes will be returned instead of the published node. If no preview node exists or the requestor doesn't have proper capabilities to preview, no node will be returned.

Example

Query
query contentNode(  $id: ID!,  $idType: ContentNodeIdTypeEnum,$contentType: ContentTypeEnum,$asPreview: Boolean){  contentNode(    id: $id,    idType: $idType,    contentType: $contentType,    asPreview: $asPreview  ){    contentType {      ...ContentNodeToContentTypeConnectionEdgeFragment    }contentTypeNamedatabaseIddatedateGmtdesiredSlugeditingLockedBy {      ...ContentNodeToEditLockConnectionEdgeFragment    }enclosureenqueuedScripts {      ...ContentNodeToEnqueuedScriptConnectionFragment    }enqueuedStylesheets {      ...ContentNodeToEnqueuedStylesheetConnectionFragment    }guididisContentNodeisPreviewisRestrictedisTermNodelastEditedBy {      ...ContentNodeToEditLastConnectionEdgeFragment    }linkmodifiedmodifiedGmtpreviewRevisionDatabaseIdpreviewRevisionIdseo {      ...PostTypeSEOFragment    }slugstatustemplate {      ...ContentTemplateFragment    }uri  }}
Variables
{"id":4,"idType":"DATABASE_ID","contentType":"ATTACHMENT","asPreview":false}
Response
{"data":{"contentNode":{"contentType":ContentNodeToContentTypeConnectionEdge,"contentTypeName":"xyz789","databaseId":987,"date":"abc123","dateGmt":"xyz789","desiredSlug":"abc123","editingLockedBy":ContentNodeToEditLockConnectionEdge,"enclosure":"abc123","enqueuedScripts":ContentNodeToEnqueuedScriptConnection,"enqueuedStylesheets":ContentNodeToEnqueuedStylesheetConnection,"guid":"xyz789","id":"4","isContentNode":false,"isPreview":false,"isRestricted":false,"isTermNode":false,"lastEditedBy":ContentNodeToEditLastConnectionEdge,"link":"xyz789","modified":"abc123","modifiedGmt":"xyz789","previewRevisionDatabaseId":987,"previewRevisionId":4,"seo":PostTypeSEO,"slug":"xyz789","status":"abc123","template":ContentTemplate,"uri":"xyz789"}}}