Schema Documentation
Product
Description
The Product type
Fields
Field Name | Description |
---|---|
productId - Int! | The id field matches the WP_Post->ID field. Deprecated in favor of the databaseId field |
addons - [ProductAddonField] | Product addons connected to this product. |
allPaColor - ProductToPaColorConnection | Connection between the Product type and the paColor type |
Arguments
| |
allPaSize - ProductToPaSizeConnection | Connection between the Product type and the paSize type |
Arguments
| |
attributes - ProductToProductAttributeConnection | Connection between the Product type and the ProductAttribute type |
Arguments
| |
averageRating - Float | Product average count |
catalogVisibility - CatalogVisibilityEnum | Catalog visibility |
commentCount - Int | The number of comments. Even though WPGraphQL denotes this field as an integer, in WordPress this field should be saved as a numeric string for compatibility. |
commentStatus - String | Whether the comments are open or closed for this particular post. |
comments - ProductToCommentsConnection | Connection between the Product type and the Comment type |
Arguments
| |
content - String | The content of the post. |
Arguments
| |
contentType - ContentNodeToContentTypeConnectionEdge | Connection between the ContentNode type and the ContentType type |
contentTypeName - String! | The name of the Content Type the node belongs to |
databaseId - Int! | The unique identifier stored in the database |
date - String | Post publishing date. |
dateGmt - String | The publishing date set in GMT. |
dateOnSaleFrom - String | Date on sale from |
dateOnSaleTo - String | Date on sale to |
description - String | Product description |
Arguments
| |
desiredSlug - String | The desired slug of the post |
editingLockedBy - ContentNodeToEditLockConnectionEdge | If a user has edited the node within the past 15 seconds, this will return the user that last edited. Null if the edit lock doesn't exist or is greater than 15 seconds |
editorBlocks - [ProductEditorBlock] | List of product editor blocks |
Arguments
| |
enclosure - String | The RSS enclosure for the object |
enqueuedScripts - ContentNodeToEnqueuedScriptConnection | Connection between the ContentNode type and the EnqueuedScript type |
Arguments
| |
enqueuedStylesheets - ContentNodeToEnqueuedStylesheetConnection | Connection between the ContentNode type and the EnqueuedStylesheet type |
Arguments
| |
excerpt - String | The excerpt of the post. |
Arguments
| |
featured - Boolean | If the product is featured |
featuredImage - NodeWithFeaturedImageToMediaItemConnectionEdge | Connection between the NodeWithFeaturedImage type and the MediaItem type |
featuredImageDatabaseId - Int | The database identifier for the featured image node assigned to the content node |
featuredImageId - ID | Globally unique ID of the featured image assigned to the node |
galleryImages - ProductToMediaItemConnection | Connection between the Product type and the MediaItem type |
Arguments
| |
globalAttributes - ProductToGlobalProductAttributeConnection | Connection between the Product type and the GlobalProductAttribute type |
Arguments
| |
guid - String | The global unique identifier for this post. This currently matches the value stored in WP_Post->guid and the guid column in the "post_objects" database table. |
id - ID! | The globally unique identifier of the product object. |
image - MediaItem | Main image |
isContentNode - Boolean! | Whether the node is a Content Node |
isPreview - Boolean | Whether the object is a node in the preview state |
isRestricted - Boolean | Whether the object is restricted from the current viewer |
isTermNode - Boolean! | Whether the node is a Term |
lastEditedBy - ContentNodeToEditLastConnectionEdge | The user that most recently edited the node |
link - String | The permalink of the post |
localAttributes - ProductToLocalProductAttributeConnection | Connection between the Product type and the LocalProductAttribute type |
Arguments
| |
menuOrder - Int | Menu order |
metaData - [MetaData] | Object meta data |
modified - String | The local modified time for a post. If a post was recently updated the modified field will change to match the corresponding time. |
modifiedGmt - String | The GMT modified time for a post. If a post was recently updated the modified field will change to match the corresponding time in GMT. |
name - String | Product name |
onSale - Boolean | Is product on sale? |
preview - ProductToPreviewConnectionEdge | Connection between the Product type and the Product type |
Arguments
| |
previewRevisionDatabaseId - Int | The database id of the preview node |
previewRevisionId - ID | Whether the object is a node in the preview state |
productCategories - ProductToProductCategoryConnection | Connection between the Product type and the productCategory type |
Arguments
| |
productTags - ProductToProductTagConnection | Connection between the Product type and the productTag type |
Arguments
| |
productTypes - ProductToProductTypeConnection | Connection between the Product type and the productType type |
Arguments
| |
purchasable - Boolean | Can product be purchased? |
purchaseNote - String | Purchase note |
related - ProductToProductUnionConnection | Connection between the Product type and the ProductUnion type |
Arguments
| |
reviewCount - Int | Product review count |
reviews - ProductToCommentConnection | Connection between the Product type and the Comment type |
Arguments
| |
reviewsAllowed - Boolean | If reviews are allowed |
seo - PostTypeSEO | The Yoast SEO data of the ContentNode |
shippingClasses - ProductToShippingClassConnection | Connection between the Product type and the shippingClass type |
Arguments
| |
shortDescription - String | Product short description |
Arguments
| |
sku - String | Product SKU |
slug - String | The uri slug for the post. This is equivalent to the WP_Post->post_name field and the post_name column in the database for the "post_objects" table. |
status - String | The current status of the object |
template - ContentTemplate | The template assigned to the node |
terms - ProductToTermNodeConnection | Connection between the Product type and the TermNode type |
Arguments
| |
title - String | The title of the post. This is currently just the raw title. An amendment to support rendered title needs to be made. |
Arguments
| |
totalSales - Int | Number total of sales |
type - ProductTypesEnum | Product type |
upsell - ProductToUpsellConnection | Connection between the Product type and the ProductUnion type |
Arguments
| |
uri - String | The unique resource identifier path |
visibleProducts - ProductToVisibleProductConnection | Connection between the Product type and the visibleProduct type |
Arguments
|
Example
{"productId":987,"addons":[ProductAddonField],"allPaColor":ProductToPaColorConnection,"allPaSize":ProductToPaSizeConnection,"attributes":ProductToProductAttributeConnection,"averageRating":123.45,"catalogVisibility":"CATALOG","commentCount":123,"commentStatus":"abc123","comments":ProductToCommentsConnection,"content":"abc123","contentType":ContentNodeToContentTypeConnectionEdge,"contentTypeName":"xyz789","databaseId":123,"date":"xyz789","dateGmt":"abc123","dateOnSaleFrom":"abc123","dateOnSaleTo":"abc123","description":"xyz789","desiredSlug":"abc123","editingLockedBy":ContentNodeToEditLockConnectionEdge,"editorBlocks":[ProductEditorBlock],"enclosure":"xyz789","enqueuedScripts":ContentNodeToEnqueuedScriptConnection,"enqueuedStylesheets":ContentNodeToEnqueuedStylesheetConnection,"excerpt":"xyz789","featured":false,"featuredImage":NodeWithFeaturedImageToMediaItemConnectionEdge,"featuredImageDatabaseId":987,"featuredImageId":"4","galleryImages":ProductToMediaItemConnection,"globalAttributes":ProductToGlobalProductAttributeConnection,"guid":"xyz789","id":"4","image":MediaItem,"isContentNode":false,"isPreview":true,"isRestricted":true,"isTermNode":true,"lastEditedBy":ContentNodeToEditLastConnectionEdge,"link":"xyz789","localAttributes":ProductToLocalProductAttributeConnection,"menuOrder":987,"metaData":[MetaData],"modified":"xyz789","modifiedGmt":"xyz789","name":"xyz789","onSale":false,"preview":ProductToPreviewConnectionEdge,"previewRevisionDatabaseId":987,"previewRevisionId":4,"productCategories":ProductToProductCategoryConnection,"productTags":ProductToProductTagConnection,"productTypes":ProductToProductTypeConnection,"purchasable":false,"purchaseNote":"abc123","related":ProductToProductUnionConnection,"reviewCount":987,"reviews":ProductToCommentConnection,"reviewsAllowed":false,"seo":PostTypeSEO,"shippingClasses":ProductToShippingClassConnection,"shortDescription":"xyz789","sku":"xyz789","slug":"abc123","status":"xyz789","template":ContentTemplate,"terms":ProductToTermNodeConnection,"title":"xyz789","totalSales":987,"type":"BUNDLE","upsell":ProductToUpsellConnection,"uri":"xyz789","visibleProducts":ProductToVisibleProductConnection}