File size: 499 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// @flow
import type { GraphQLContext } from '../../';
import type { DBThread } from 'shared/types';

export default async (root: DBThread, _: any, ctx: GraphQLContext) => {
  const { communityId, id } = root;
  const { loaders } = ctx;
  const community = await loaders.community.load(communityId);
  if (!community) {
    console.error(
      'User queried thread of non-existent/deleted community: ',
      communityId
    );
    console.error('Thread queried: ', id);
  }
  return community;
};