File size: 951 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// @flow
import thread from './rootThread';
import attachments from './attachments';
import channel from './channel';
import community from './community';
import participants from './participants';
import isAuthor from './isAuthor';
import isCreator from './isCreator'; // deprecated
import messageConnection from './messageConnection';
import author from './author';
import creator from './creator';
import content from './content';
import reactions from './reactions';
import metaImage from './metaImage';
import editedBy from './editedBy';

import type { DBThread } from 'shared/types';

module.exports = {
  Query: {
    thread,
  },
  Thread: {
    attachments,
    channel,
    community,
    participants,
    isAuthor,
    isCreator, // deprcated
    messageConnection,
    author,
    creator, // deprecated
    content,
    reactions,
    metaImage,
    messageCount: ({ messageCount }: DBThread) => messageCount || 0,
    editedBy,
  },
};