Schema Documentation
contentNode
Description
A node used to manage content
Response
Returns a
ContentNode
Arguments
Name | Description |
---|---|
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 node as a preview instance |
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":123,"date":"abc123","dateGmt":"xyz789","desiredSlug":"abc123","editingLockedBy":ContentNodeToEditLockConnectionEdge,"enclosure":"abc123","enqueuedScripts":ContentNodeToEnqueuedScriptConnection,"enqueuedStylesheets":ContentNodeToEnqueuedStylesheetConnection,"guid":"abc123","id":4,"isContentNode":false,"isPreview":true,"isRestricted":true,"isTermNode":true,"lastEditedBy":ContentNodeToEditLastConnectionEdge,"link":"xyz789","modified":"abc123","modifiedGmt":"xyz789","previewRevisionDatabaseId":987,"previewRevisionId":4,"seo":PostTypeSEO,"slug":"xyz789","status":"abc123","template":ContentTemplate,"uri":"xyz789"}}}