Search.../

queryDraftPosts( )

Developer Preview

Retrieves a list of up to 100 draft posts, given the provided paging, filtering, and sorting.

Description

Query Draft Posts runs with these defaults, which you can override:

  • editedDate is sorted in DESC order.
  • paging.limit is 50.
  • paging.offset is 0.
PROPERTYSUPPORTED FILTERS & SORTING
_ideq(),ne(),hasSome(),ascending(),descending()
titleeq(),ne(),startsWith(),hasSome(),exists(),in(),ascending(),descending()
excerpteq(),ne(),startsWith(),hasSome(),exists(),in(),ascending(),descending()
featuredeq(),ne(),ascending(),descending()
categoryIdshasSome(),hasAll()
memberIdeq(),ne(),hasSome()
hashtagshasSome(),hasAll()
commentingEnabledeq(),ne(),ascending(),descending()
minutesToReadeq(),ne(),lt(),le(),gt(),ge(),in()
tagIdshasSome(),hasAll()
pricingPlanIdshasSome(),hasAll()
translationIdeq(),ne(),exists(),in()
languageeq(),ne(),hasSome(),exists(),in()
statuseq(),ne(),hasSome(),exists(),in(),ascending(),descending()
hasUnpublishedChangeseq(),ne(),ascending(),descending()
editedDateeq(),ne(),lt(),le(),gt(),ge(),in(),ascending(),descending()
scheduledPublishDateeq(),ne(),lt(),le(),gt(),ge(),in(),ascending(),descending()
Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function queryDraftPosts(options: QueryDraftPostsOptions): DraftPostsQueryBuilder

queryDraftPosts Parameters

NAME
TYPE
DESCRIPTION
options
Optional
QueryDraftPostsOptions

Options for querying draft posts.

Returns

Was this helpful?

queryDraftPosts example

Copy Code
1import { draftPosts } from 'wix-blog-backend';
2
3 async function queryDraftPosts() {
4 const { items } = draftPosts.queryDraftPosts().find();
5 }
6