Skip to content

Commit

Permalink
[PRTL-2534] update schema with CIViC attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
justincorrigible committed Jun 7, 2019
1 parent 9568568 commit 682d263
Show file tree
Hide file tree
Showing 3 changed files with 9,728 additions and 5,241 deletions.
11 changes: 6 additions & 5 deletions data/getSchema.js
Expand Up @@ -6,20 +6,21 @@ const {
printSchema,
} = require('graphql/utilities');
const path = require('path');

const schemaPath = path.join(__dirname, 'schema');

const SERVER = 'http://localhost:5000/graphql';
// Takes 'node /data/getSchema.js https://api.gdc.cancer.gov/v0/'
const SERVER = `${process.argv[2] || 'http://localhost:5000/'}graphql`;

// Save JSON of full schema introspection for Babel Relay Plugin to use
fetch(SERVER, {
method: 'POST',
body: JSON.stringify({ query: introspectionQuery }),
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({ query: introspectionQuery }),
})
.then(res => res.json())
method: 'POST',
}).then(res => res.json())
.then(schemaJSON => {
fs.writeFileSync(`${schemaPath}.json`, JSON.stringify(schemaJSON, null, 2));

Expand Down

0 comments on commit 682d263

Please sign in to comment.