Schema Documentation

Post

Description

The post type

Fields
Field NameDescription
author - NodeWithAuthorToUserConnectionEdge Connection between the NodeWithAuthor type and the User type
authorDatabaseId - Int The database identifier of the author of the node
authorId - ID The globally unique identifier of the author of the node
categories - PostToCategoryConnection Connection between the Post type and the category type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

where - PostToCategoryConnectionWhereArgs

Arguments for filtering the connection

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 - PostToCommentConnection Connection between the Post type and the Comment type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

where - PostToCommentConnectionWhereArgs

Arguments for filtering the connection

content - String The content of the post.
Arguments
format - PostObjectFieldFormatEnum

Format of the field output

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.
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 - [PostEditorBlock] List of post editor blocks
Arguments
flat - Boolean
enclosure - String The RSS enclosure for the object
enqueuedScripts - ContentNodeToEnqueuedScriptConnection Connection between the ContentNode type and the EnqueuedScript type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

enqueuedStylesheets - ContentNodeToEnqueuedStylesheetConnection Connection between the ContentNode type and the EnqueuedStylesheet type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

excerpt - String The excerpt of the post.
Arguments
format - PostObjectFieldFormatEnum

Format of the field output

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
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 post object.
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
isRevision - Boolean True if the node is a revision of another node
isSticky - Boolean! Whether this page is sticky
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
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.
pingStatus - String Whether the pings are open or closed for this particular post.
pinged - [String] URLs that have been pinged.
postFormats - PostToPostFormatConnection Connection between the Post type and the postFormat type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

where - PostToPostFormatConnectionWhereArgs

Arguments for filtering the connection

postId - Int! The id field matches the WP_Post->ID field. Deprecated in favor of the databaseId field
preview - PostToPreviewConnectionEdge Connection between the Post type and the post type
previewRevisionDatabaseId - Int The database id of the preview node
previewRevisionId - ID Whether the object is a node in the preview state
revisionOf - NodeWithRevisionsToContentNodeConnectionEdge If the current node is a revision, this field exposes the node this is a revision of. Returns null if the node is not a revision of another node.
revisions - PostToRevisionConnection Connection between the Post type and the post type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

where - PostToRevisionConnectionWhereArgs

Arguments for filtering the connection

seo - PostTypeSEO The Yoast SEO data of the ContentNode
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
tags - PostToTagConnection Connection between the Post type and the tag type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

where - PostToTagConnectionWhereArgs

Arguments for filtering the connection

template - ContentTemplate The template assigned to the node
terms - PostToTermNodeConnection Connection between the Post type and the TermNode type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

where - PostToTermNodeConnectionWhereArgs

Arguments for filtering the connection

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
format - PostObjectFieldFormatEnum

Format of the field output

toPing - [String] URLs queued to be pinged.
uri - String The unique resource identifier path
Example
{"author":NodeWithAuthorToUserConnectionEdge,"authorDatabaseId":123,"authorId":"4","categories":PostToCategoryConnection,"commentCount":123,"commentStatus":"abc123","comments":PostToCommentConnection,"content":"abc123","contentType":ContentNodeToContentTypeConnectionEdge,"contentTypeName":"xyz789","databaseId":123,"date":"xyz789","dateGmt":"xyz789","desiredSlug":"xyz789","editingLockedBy":ContentNodeToEditLockConnectionEdge,"editorBlocks":[PostEditorBlock],"enclosure":"xyz789","enqueuedScripts":ContentNodeToEnqueuedScriptConnection,"enqueuedStylesheets":ContentNodeToEnqueuedStylesheetConnection,"excerpt":"abc123","featuredImage":NodeWithFeaturedImageToMediaItemConnectionEdge,"featuredImageDatabaseId":987,"featuredImageId":4,"guid":"xyz789","id":"4","isContentNode":false,"isPreview":false,"isRestricted":false,"isRevision":true,"isSticky":true,"isTermNode":false,"lastEditedBy":ContentNodeToEditLastConnectionEdge,"link":"xyz789","modified":"abc123","modifiedGmt":"xyz789","pingStatus":"xyz789","pinged":["abc123"],"postFormats":PostToPostFormatConnection,"postId":123,"preview":PostToPreviewConnectionEdge,"previewRevisionDatabaseId":987,"previewRevisionId":"4","revisionOf":NodeWithRevisionsToContentNodeConnectionEdge,"revisions":PostToRevisionConnection,"seo":PostTypeSEO,"slug":"abc123","status":"abc123","tags":PostToTagConnection,"template":ContentTemplate,"terms":PostToTermNodeConnection,"title":"xyz789","toPing":["xyz789"],"uri":"xyz789"}