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