Download spectrum/api/queries/thread/channel.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 483 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/queries/thread/channel.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/api/queries/thread/channel.js
-
curl -L -o channel.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/queries/thread/channel.js
483 Bytes
| // @flow | |
| import type { GraphQLContext } from '../../'; | |
| import type { DBThread } from 'shared/types'; | |
| export default async (root: DBThread, _: any, ctx: GraphQLContext) => { | |
| const { channelId, id } = root; | |
| const { loaders } = ctx; | |
| const channel = await loaders.channel.load(channelId); | |
| if (!channel) { | |
| console.error( | |
| 'User queried thread of non-existent/deleted channel: ', | |
| channelId | |
| ); | |
| console.error('Thread queried: ', id); | |
| } | |
| return channel; | |
| }; | |