Posts
#
Find and load a single post#
findPostExample:
Properties | Description |
---|---|
id | ID of the desired struct. |
visibility | Filter for the visible state of the structs (see Visibility). |
๐ PostData: CommonData < Post, PostContent >
#
findPostWithAllDetailsFinds and loads a post with their extension, and the owner's profile and space (if defined).
Example:
#
findPostWithSomeDetailsExample:
Properties | Description |
---|---|
id | ID of desired struct. |
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. |
๐ PostWithSomeDetails: { ext?: Exclude<PostWithSomeDetails, "ext">; owner?: ProfileData; post: PostData; space?: SpaceData }
๐ FindPostWithDetailsQuery: FindPostQuery & PostDetailsOpts
๐ Visibility: 'onlyVisible' | 'onlyHidden' | 'onlyPublic' | 'onlyUnlisted'
#
Find and load an array of posts#
findAllPostsExample:
๐ PostData: CommonData < Post, PostContent >
#
findPostsExample:
Properties | Description |
---|---|
ids | An array of IDs of the desired structs. |
visibility | Filter for the visible state of the structs (see Visibility). |
withContentOnly? | Boolean. |
๐ Visibility: 'onlyVisible' | 'onlyHidden' | 'onlyPublic' | 'onlyUnlisted'
The four visible state filters correspond to these 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. |
๐ PostData: CommonData < Post, PostContent >
#
findPostsWithAllDetailsFinds and loads a posts with their extension, and the owner's profile and space (if defined).
Example:
Properties | Description |
---|---|
ids | An array of IDs of the desired structs. |
visibility | Filter for the visible state of the structs (see Visibility) |
withContentOnly? | Boolean. |
๐ 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. |
๐ FindPostsQuery: FindStructs < AnyPostId >
#
findPostsWithSomeDetailsFinds and loads posts with their extension, and the owner's profile and and space (if defined and specified in properties).
Example:
Properties | Description |
---|---|
ids | An array of IDs of the 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. |
๐ PostWithSomeDetails: { ext?: Exclude<PostWithSomeDetails, "ext">; owner?: ProfileData; post: PostData; space?: SpaceData }
๐ FindPostWithDetailsQuery: FindPostQuery & PostDetailsOpts
๐ Visibility: 'onlyVisible' | 'onlyHidden' | 'onlyPublic' | 'onlyUnlisted'
#
findPublicPostsWithAllDetailsFinds and loads posts that have the hidden == false
field in the Substrate struct, and their IPFS content is not empty, with their extension, and the owner's profile and space (if defined).
Example:
#
findPublicPostsWithSomeDetailsFinds and loads posts that have the hidden == false
field in the Substrate struct and their IPFS content is not empty, with their extension, and the owner's profile and space (if defined and specified in properties).
Example:
Properties | Description |
---|---|
ids | An array of IDs of the 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. |
๐ PostWithSomeDetails: { ext?: Exclude<PostWithSomeDetails, "ext">; owner?: ProfileData; post: PostData; space?: SpaceData }
๐ FindPostWithDetailsQuery: FindPostQuery & PostDetailsOpts
๐ Visibility: 'onlyVisible' | 'onlyHidden' | 'onlyPublic' | 'onlyUnlisted'
#
findUnlistedPostsFinds and loads an array of information about unlisted posts from the Subsocial blockchain and IPFS by a given array of post ids
.
A post is considered unlisted if it meets either of these conditions:
- The
hidden
field on it's blockchain structure istrue
. - Or there is no corresponding JSON file that represents the post's content on IPFS.
Example:
๐ PostData: CommonData < Post, PostContent >
#
findUnlistedPostsWithAllDetailsFinds and loads posts that have the hidden == true
field in the Substrate struct and their IPFS content is not empty, with their extension, and the owner's profile and space (if defined).
Example:
#
findUnlistedPostsWithSomeDetailsFinds and loads posts that have the' hidden == true' field in the Substrate struct and their IPFS content is not empty, with their extension, and owner's profile and space (if defined and specified in properties).
Example:
Properties | Description |
---|---|
ids | An array of IDs of the 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. |
๐ PostWithSomeDetails: { ext?: Exclude<PostWithSomeDetails, "ext">; owner?: ProfileData; post: PostData; space?: SpaceData }
๐ FindPostsWithDetailsQuery: FindPostsQuery & PostDetailsOpts
๐ Visibility: 'onlyVisible' | 'onlyHidden' | 'onlyPublic' | 'onlyUnlisted'