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 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":"abc123","databaseId":123,"date":"abc123","dateGmt":"xyz789","desiredSlug":"xyz789","editingLockedBy":ContentNodeToEditLockConnectionEdge,"enclosure":"xyz789","enqueuedScripts":ContentNodeToEnqueuedScriptConnection,"enqueuedStylesheets":ContentNodeToEnqueuedStylesheetConnection,"guid":"xyz789","id":"4","isContentNode":true,"isPreview":false,"isRestricted":false,"isTermNode":false,"lastEditedBy":ContentNodeToEditLastConnectionEdge,"link":"abc123","modified":"xyz789","modifiedGmt":"abc123","previewRevisionDatabaseId":987,"previewRevisionId":4,"seo":PostTypeSEO,"slug":"xyz789","status":"abc123","template":ContentTemplate,"uri":"xyz789"}}}
©  2021-2023WPGraphQL WooCommerce.All rights reserved.