Schema Documentation

category

Description

A 0bject

Response

Returns a Category

Arguments
NameDescription
id - ID! The globally unique identifier of the object.
idType - CategoryIdType Type of unique identifier to fetch by. Default is Global ID

Example

Query
query category(  $id: ID!,  $idType: CategoryIdType){  category(    id: $id,    idType: $idType  ){    ancestors {      ...CategoryToAncestorsCategoryConnectionFragment    }categoryIdchildren {      ...CategoryToCategoryConnectionFragment    }contentNodes {      ...CategoryToContentNodeConnectionFragment    }countdatabaseIddescriptionenqueuedScripts {      ...TermNodeToEnqueuedScriptConnectionFragment    }enqueuedStylesheets {      ...TermNodeToEnqueuedStylesheetConnectionFragment    }idisContentNodeisRestrictedisTermNodelinknameparent {      ...CategoryToParentCategoryConnectionEdgeFragment    }parentDatabaseIdparentIdposts {      ...CategoryToPostConnectionFragment    }seo {      ...TaxonomySEOFragment    }slugtaxonomy {      ...CategoryToTaxonomyConnectionEdgeFragment    }taxonomyNametermGroupIdtermTaxonomyIduri  }}
Variables
{"id":"4","idType":"DATABASE_ID"}
Response
{"data":{"category":{"ancestors":CategoryToAncestorsCategoryConnection,"categoryId":987,"children":CategoryToCategoryConnection,"contentNodes":CategoryToContentNodeConnection,"count":987,"databaseId":123,"description":"xyz789","enqueuedScripts":TermNodeToEnqueuedScriptConnection,"enqueuedStylesheets":TermNodeToEnqueuedStylesheetConnection,"id":4,"isContentNode":true,"isRestricted":false,"isTermNode":false,"link":"abc123","name":"xyz789","parent":CategoryToParentCategoryConnectionEdge,"parentDatabaseId":123,"parentId":4,"posts":CategoryToPostConnection,"seo":TaxonomySEO,"slug":"abc123","taxonomy":CategoryToTaxonomyConnectionEdge,"taxonomyName":"abc123","termGroupId":123,"termTaxonomyId":987,"uri":"abc123"}}}
©  2021-2023WPGraphQL WooCommerce.All rights reserved.