Download spectrum/api/queries/thread/community.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 499 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/queries/thread/community.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/api/queries/thread/community.js
-
curl -L -o community.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/queries/thread/community.js
499 Bytes
| // @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; | |
| }; | |