Download spectrum/api/queries/community/rootCommunity.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 467 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/queries/community/rootCommunity.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/api/queries/community/rootCommunity.js
-
curl -L -o rootCommunity.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/queries/community/rootCommunity.js
467 Bytes
| // @flow | |
| import type { GraphQLContext } from '../../'; | |
| type GetCommunityById = { | |
| id: string, | |
| slug: void, | |
| }; | |
| type GetCommunityBySlug = { | |
| id: void, | |
| slug: string, | |
| }; | |
| type GetCommunityArgs = GetCommunityById | GetCommunityBySlug; | |
| export default ( | |
| _: any, | |
| args: GetCommunityArgs, | |
| { loaders }: GraphQLContext | |
| ) => { | |
| if (args.id) return loaders.community.load(args.id); | |
| if (args.slug) return loaders.communityBySlug.load(args.slug); | |
| return null; | |
| }; | |