mirror of
https://github.com/BradNut/graphbrainz
synced 2025-09-08 17:40:32 +00:00
12 lines
342 B
JavaScript
12 lines
342 B
JavaScript
import { graphql, introspectionQuery, printSchema } from 'graphql'
|
|
import schema from '../src/schema'
|
|
|
|
if (process.argv[2] === '--json') {
|
|
graphql(schema, introspectionQuery).then(result => {
|
|
console.log(JSON.stringify(result.data, null, 2))
|
|
}).catch(err => {
|
|
console.error(err)
|
|
})
|
|
} else {
|
|
console.log(printSchema(schema))
|
|
}
|