Download spectrum/scripts/introspection-query.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 711 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/scripts/introspection-query.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/scripts/introspection-query.js
-
curl -L -o introspection-query.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/scripts/introspection-query.js
711 Bytes
| const fetch = require('node-fetch'); | |
| const fs = require('fs'); | |
| fetch(`http://localhost:3001/api`, { | |
| method: 'POST', | |
| headers: { 'Content-Type': 'application/json' }, | |
| body: JSON.stringify({ | |
| query: ` | |
| { | |
| __schema { | |
| types { | |
| kind | |
| name | |
| possibleTypes { | |
| name | |
| } | |
| } | |
| } | |
| } | |
| `, | |
| }), | |
| }) | |
| .then(result => result.json()) | |
| .then(result => { | |
| fs.writeFile( | |
| './fragmentTypes.json', | |
| JSON.stringify(result.data, null, 2), | |
| err => { | |
| if (err) console.error('Error writing fragmentTypes file', err); | |
| console.log('Fragment types successfully extracted!'); | |
| } | |
| ); | |
| }); | |