including CAIT data, models and seeds

This commit is contained in:
Eric Hulburd
2016-01-26 19:42:30 -06:00
commit 220ddfed19
47 changed files with 16607 additions and 0 deletions

29
scripts/updateSchema.js Executable file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env babel-node --optional es7.asyncFunctions
import fs from 'fs';
import path from 'path';
import { Schema } from '../data/schema';
import { graphql } from 'graphql';
import { introspectionQuery, printSchema } from 'graphql/utilities';
// Save JSON of full schema introspection for Babel Relay Plugin to use
(async () => {
var result = await (graphql(Schema, introspectionQuery));
if (result.errors) {
console.error(
'ERROR introspecting schema: ',
JSON.stringify(result.errors, null, 2)
);
} else {
fs.writeFileSync(
path.join(__dirname, '../data/schema.json'),
JSON.stringify(result, null, 2)
);
}
})();
// Save user readable type system shorthand of schema
fs.writeFileSync(
path.join(__dirname, '../data/schema.graphql'),
printSchema(Schema)
);