Posts With Details
All entities (posts, profiles, and spaces) are interconnected. For faster data retrieval use
the findPostWithAllDetails
method.
#
Find and load a single post#
findPostWithAllDetailsFinds and loads a post with their extension and the owner's profile and space (if defined).
Example:
Output:
#
findPostWithSomeDetailsFinds and loads a post with their extension and the owner's profile (if defined).
Properties | Description |
---|---|
ids | An array of IDs of desired structs. |
visibility | Filter for the visible state of the structs (see Visibility) |
withContentOnly? | Boolean. |
withSpace? | Pass true to get the space data. |
withOwner? | Pass true to get the profile data. |
๐ Visibility: 'onlyVisible' | 'onlyHidden' | 'onlyPublic' | 'onlyUnlisted'
The four visible state filters correspond to the next conditions:
Filters | Description |
---|---|
onlyVisible | returns posts where the hidden field on the corresponding Substrate struct is false . |
onlyHidden | returns posts where the hidden field on the corresponding Substrate struct is true . |
onlyPublic | returns posts where the hidden field on the corresponding Substrate struct is false and there is a corresponding JSON file on IPFS. |
onlyUnlisted | returns posts where either the hidden field is true or there is no corresponding JSON file on IPFS. |
Example:
Output:
Example with owner:
Output:
๐ PostWithSomeDetails: { ext?: Exclude<PostWithSomeDetails, "ext">; owner?: ProfileData; post: PostData; space?: SpaceData }
๐ FindPostWithDetailsQuery: FindPostQuery & PostDetailsOpts
#
Find and load an array of posts#
findPostsWithAllDetailsfindPostsWithAllDetails returns information of the post, space and owner (profile).
Properties | Description |
---|---|
ids | An array of IDs of desired structs. |
visibility | Filter for the visible state of the structs (see Visibility) |
withContentOnly? | Boolean. |
๐ FindPostsQuery: FindStructs < AnyPostId >
๐ There are also methods with ready-made visibility filters.
#
findPublicPostsWithAllDetailsFind and load posts that have the hidden == false
field in their Substrate struct and their IPFS content is
not empty, using their extension and the owner's profile and space (if defined).
#
findUnlistedPostsWithAllDetailsFind and load posts that have the hidden == true
field in their Substrate struct and their IPFS content is
not empty, using their extension and owner's profile and space (if defined).
#
findPublicPostsWithSomeDetailsLoad an array of information about public posts with the space and/or owner.
Properties | Description |
---|---|
ids | An array of IDs of desired structs. |
visibility | Filter for the visible state of the structs (see Visibility) |
withContentOnly? | Boolean. |
withSpace? | Pass true to get the space data. |
withOwner? | Pass true to get the profile data. |
๐ FindPostsWithDetailsQuery: FindPostsQuery & PostDetailsOpts
๐ PostWithSomeDetails: { ext?: Exclude<PostWithSomeDetails, "ext">; owner?: ProfileData; post: PostData; space?: SpaceData }