@@ -15,6 +15,7 @@ import {
1515 MessageSearchSuggestions ,
1616 AllLikedMessagesByUser ,
1717 AllForYouMessages ,
18+ AllFollowingFeedMessages ,
1819 AllChannelMessages ,
1920 MessageWithFileInputInterface ,
2021} from '../../types' ;
@@ -42,6 +43,7 @@ import {
4243 GET_MESSAGES_GROUP_BY_DATE_QUERY ,
4344 GET_MESSAGES_LIKED_BY_USER ,
4445 GET_MESSAGES_QUERY ,
46+ GET_FOLLOWING_FEED_QUERY
4547} from '../../queries' ;
4648
4749import { MessagesComments } from '../messages-comments' ;
@@ -264,6 +266,52 @@ export class Messages {
264266 return response . data ;
265267 }
266268
269+ public async getFollowingFeedMessages (
270+ options : {
271+ where ?: WhereCondition ;
272+ orderBy ?: Array < OrderByMessage > ;
273+ search ?: string ;
274+ first ?: number ;
275+ page ?: number ;
276+ hasTags ?: WhereCondition ;
277+ hasType ?: WhereCondition ;
278+ childrenOptions ?: {
279+ alias ?: string ; // Alias for the children field
280+ first ?: number ; // Limit for children
281+ } ;
282+ } = { }
283+ ) : Promise < AllFollowingFeedMessages > {
284+ const {
285+ search,
286+ hasTags,
287+ hasType,
288+ where,
289+ orderBy,
290+ first = 25 ,
291+ page,
292+ childrenOptions = { } ,
293+ } = options ;
294+
295+ const { alias = 'children' , first : childrenFirst } = childrenOptions ;
296+
297+ const response = await this . client . query ( {
298+ query : GET_FOLLOWING_FEED_QUERY ( childrenFirst !== undefined , alias ) ,
299+ variables : {
300+ where,
301+ hasTags,
302+ hasType,
303+ orderBy,
304+ search,
305+ first,
306+ page,
307+ ...( childrenFirst !== undefined && { childrenFirst } ) ,
308+ } ,
309+ fetchPolicy : 'no-cache' ,
310+ } ) ;
311+
312+ return response . data ;
313+ }
314+
267315 public async getChannelMessages (
268316 options : {
269317 channel_uuid ?: string ;
0 commit comments