2021-04-16 04:34:29 +00:00
|
|
|
import GraphQL from 'graphql';
|
|
|
|
|
import { baseSchema as schema } from '../src/schema.js';
|
|
|
|
|
|
|
|
|
|
const { graphql, getIntrospectionQuery, printSchema } = GraphQL;
|
2016-08-20 05:59:32 +00:00
|
|
|
|
2016-12-10 02:55:41 +00:00
|
|
|
if (process.argv[2] === '--json') {
|
2021-04-16 04:34:29 +00:00
|
|
|
graphql(schema, getIntrospectionQuery())
|
|
|
|
|
.then((result) => {
|
|
|
|
|
console.log(JSON.stringify(result, null, 2));
|
2017-11-07 05:54:56 +00:00
|
|
|
})
|
2021-04-16 04:34:29 +00:00
|
|
|
.catch((err) => {
|
|
|
|
|
console.error(err);
|
|
|
|
|
});
|
2016-12-10 02:55:41 +00:00
|
|
|
} else {
|
2021-04-16 04:34:29 +00:00
|
|
|
console.log(printSchema(schema));
|
2016-08-31 01:39:28 +00:00
|
|
|
}
|