Download spectrum/api/test/utils.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 463 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/spectrum/api/test/utils.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/spectrum/api/test/utils.js
-
curl -L -o utils.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/spectrum/api/test/utils.js
463 Bytes
| // @flow | |
| import { graphql } from 'graphql'; | |
| import createLoaders from '../loaders'; | |
| import schema from '../schema'; | |
| type Options = { | |
| context?: { | |
| user?: ?Object, | |
| }, | |
| variables?: ?Object, | |
| }; | |
| // Nice little helper function for tests | |
| export const request = (query: mixed, { context, variables }: Options = {}) => { | |
| return graphql( | |
| schema, | |
| query, | |
| undefined, | |
| { | |
| loaders: createLoaders(), | |
| ...context, | |
| }, | |
| variables | |
| ); | |
| }; | |