Schema Documentation

contentType

Description

Fetch a Content Type node by unique Identifier

Response

Returns a ContentType

Arguments
NameDescription
id - ID! Unique Identifier for the Content Type node.
idType - ContentTypeIdTypeEnum Type of unique identifier to fetch a content type by. Default is Global ID

Example

Query
query contentType(  $id: ID!,  $idType: ContentTypeIdTypeEnum){  contentType(    id: $id,    idType: $idType  ){    canExportconnectedTaxonomies {      ...ContentTypeToTaxonomyConnectionFragment    }contentNodes {      ...ContentTypeToContentNodeConnectionFragment    }deleteWithUserdescriptionexcludeFromSearchgraphqlPluralNamegraphqlSingleNamehasArchivehierarchicalidisContentNodeisFrontPageisPostsPageisRestrictedisTermNodelabellabels {      ...PostTypeLabelDetailsFragment    }menuIconmenuPositionnamepublicpubliclyQueryablerestBaserestControllerClassshowInAdminBarshowInGraphqlshowInMenushowInNavMenusshowInRestshowUiuri  }}
Variables
{"id":4,"idType":"ID"}
Response
{"data":{"contentType":{"canExport":false,"connectedTaxonomies":ContentTypeToTaxonomyConnection,"contentNodes":ContentTypeToContentNodeConnection,"deleteWithUser":false,"description":"abc123","excludeFromSearch":false,"graphqlPluralName":"abc123","graphqlSingleName":"abc123","hasArchive":true,"hierarchical":true,"id":4,"isContentNode":true,"isFrontPage":false,"isPostsPage":true,"isRestricted":true,"isTermNode":true,"label":"abc123","labels":PostTypeLabelDetails,"menuIcon":"abc123","menuPosition":987,"name":"xyz789","public":true,"publiclyQueryable":false,"restBase":"abc123","restControllerClass":"abc123","showInAdminBar":false,"showInGraphql":false,"showInMenu":true,"showInNavMenus":false,"showInRest":true,"showUi":false,"uri":"xyz789"}}}
©  2021-2023WPGraphQL WooCommerce.All rights reserved.