INNER CODE UNIT · JavaScript

Promise

sheerun/graphqlviz · cli.js:79

  return new Promise(function (resolve, reject) {
    try {
      var astDocument = GraphQL.parse(text)
      var schema = GraphQL.buildASTSchema(astDocument)
      GraphQL.graphql({ schema, source: 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)
    }
  })
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…