Schema Documentation

postBy

Deprecated in favor of using the single entry point for this type with ID and IDType fields. For example, instead of postBy( id: "" ), use post(id: "" idType: "")
Description

A post object

Response

Returns a Post

Arguments
NameDescription
id - ID Get the post object by its global ID
postId - Int Get the post by its database ID
uri - String Get the post by its uri
slug - String Get the post by its slug (only available for non-hierarchical types)

Example

Query
query postBy(  $id: ID,  $postId: Int,$uri: String,$slug: String){  postBy(    id: $id,    postId: $postId,    uri: $uri,    slug: $slug  ){    author {      ...NodeWithAuthorToUserConnectionEdgeFragment    }authorDatabaseIdauthorIdcategories {      ...PostToCategoryConnectionFragment    }commentCountcommentStatuscomments {      ...PostToCommentConnectionFragment    }contentcontentType {      ...ContentNodeToContentTypeConnectionEdgeFragment    }contentTypeNamedatabaseIddatedateGmtdesiredSlugeditingLockedBy {      ...ContentNodeToEditLockConnectionEdgeFragment    }editorBlocks {      ...PostEditorBlockFragment    }enclosureenqueuedScripts {      ...ContentNodeToEnqueuedScriptConnectionFragment    }enqueuedStylesheets {      ...ContentNodeToEnqueuedStylesheetConnectionFragment    }excerptfeaturedImage {      ...NodeWithFeaturedImageToMediaItemConnectionEdgeFragment    }featuredImageDatabaseIdfeaturedImageIdguididisContentNodeisPreviewisRestrictedisRevisionisStickyisTermNodelastEditedBy {      ...ContentNodeToEditLastConnectionEdgeFragment    }linkmodifiedmodifiedGmtpingStatuspingedpostFormats {      ...PostToPostFormatConnectionFragment    }postIdpreview {      ...PostToPreviewConnectionEdgeFragment    }previewRevisionDatabaseIdpreviewRevisionIdrevisionOf {      ...NodeWithRevisionsToContentNodeConnectionEdgeFragment    }revisions {      ...PostToRevisionConnectionFragment    }seo {      ...PostTypeSEOFragment    }slugstatustags {      ...PostToTagConnectionFragment    }template {      ...ContentTemplateFragment    }terms {      ...PostToTermNodeConnectionFragment    }titletoPinguri  }}
Variables
{"id":"4","postId":123,"uri":"abc123","slug":"abc123"}
Response
{"data":{"postBy":{"author":NodeWithAuthorToUserConnectionEdge,"authorDatabaseId":123,"authorId":4,"categories":PostToCategoryConnection,"commentCount":987,"commentStatus":"xyz789","comments":PostToCommentConnection,"content":"abc123","contentType":ContentNodeToContentTypeConnectionEdge,"contentTypeName":"xyz789","databaseId":123,"date":"xyz789","dateGmt":"xyz789","desiredSlug":"xyz789","editingLockedBy":ContentNodeToEditLockConnectionEdge,"editorBlocks":[PostEditorBlock],"enclosure":"abc123","enqueuedScripts":ContentNodeToEnqueuedScriptConnection,"enqueuedStylesheets":ContentNodeToEnqueuedStylesheetConnection,"excerpt":"abc123","featuredImage":NodeWithFeaturedImageToMediaItemConnectionEdge,"featuredImageDatabaseId":123,"featuredImageId":"4","guid":"abc123","id":"4","isContentNode":true,"isPreview":true,"isRestricted":true,"isRevision":true,"isSticky":false,"isTermNode":false,"lastEditedBy":ContentNodeToEditLastConnectionEdge,"link":"abc123","modified":"abc123","modifiedGmt":"xyz789","pingStatus":"abc123","pinged":["xyz789"],"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":"abc123"}}}