cli.js
function introspect (text) {
  return new Promise(function (resolve, reject) {
    try {
      var astDocument = parse(text)
      var schema = buildASTSchema(astDocument)
      graphql(schema, graphqlviz.query)
        .then(function (data) {
          resolve(data)
        })
        .catch(function (e) {
          reject('Fatal error, exiting.')
          fatal(e, text)
        })
    } catch (e) {
      reject('Fatal error, exiting.')
      fatal(e, text)
    }
  })
}
function introspect (text) {
  return new Promise(function (resolve, reject) {
    try {
      var astDocument = parse(text)
      var schema = buildASTSchema(astDocument)
      graphql(schema, graphqlviz.query)
        .then(function (data) {
          resolve(data)
        })
        .catch(function (e) {
          reject('Fatal error, exiting.')
          fatal(e, text)
        })
    } catch (e) {
      reject('Fatal error, exiting.')
      fatal(e, text)
    }
  })
}
function introspect ( text ) { return new Promise ( function ( resolve , reject ) { try { var astDocument = parse ( text ) var schema = buildASTSchema ( astDocument ) graphql ( schema , graphqlviz . query ) . then ( function ( data ) { resolve ( data ) } ) . catch ( function ( e ) { reject ( 'Fatal error, exiting.' ) fatal ( e , text ) } ) } catch ( e ) { reject ( 'Fatal error, exiting.' ) fatal ( e , text ) } } ) }
given a "GraphQL schema language" text file, converts into introspection JSON
given a GraphQL schema language text file converts into introspection JSON