sample-proxies/graphql-sample/graphql-proxy/apiproxy/resources/jsc/graphql.jsc.js
/**
     * Prints a GraphQLError to a string, representing useful location information
     * about the error's position in the source.
     */
Prints a GraphQLError to a string, representing useful location information
about the error's position in the source.
Prints a GraphQLError to a string representing useful location information about the error ' s position in the source .
function printError(error) {
      var printedLocations = [];
      if (error.nodes) {
        var _iteratorNormalCompletion = true;
        var _didIteratorError = false;
        var _iteratorError = undefined;
        try {
          for (var _iterator = error.nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
            var node = _step.value;
            if (node.loc) {
              printedLocations.push(highlightSourceAtLocation(node.loc.source, getLocation(node.loc.source, node.loc.start)));
            }
          }
        } catch (err) {
          _didIteratorError = true;
          _iteratorError = err;
        } finally {
          try {
            if (!_iteratorNormalCompletion && _iterator.return != null) {
              _iterator.return();
            }
          } finally {
            if (_didIteratorError) {
              throw _iteratorError;
            }
          }
        }
      } else if (error.source && error.locations) {
        var source = error.source;
        var _iteratorNormalCompletion2 = true;
        var _didIteratorError2 = false;
        var _iteratorError2 = undefined;
        try {
          for (var _iterator2 = error.locations[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
            var location = _step2.value;
            printedLocations.push(highlightSourceAtLocation(source, location));
          }
        } catch (err) {
          _didIteratorError2 = true;
          _iteratorError2 = err;
        } finally {
          try {
            if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
              _iterator2.return();
            }
          } finally {
            if (_didIteratorError2) {
              throw _iteratorError2;
            }
          }
        }
      }
      return printedLocations.length === 0 ? error.message : [error.message].concat(printedLocations).join('\n\n') + '\n';
    }
function printError ( error ) { var printedLocations = [ ] ; if ( error . nodes ) { var _iteratorNormalCompletion = true ; var _didIteratorError = false ; var _iteratorError = undefined ; try { for ( var _iterator = error . nodes [ Symbol . iterator ] ( ) , _step ; ! ( _iteratorNormalCompletion = ( _step = _iterator . next ( ) ) . done ) ; _iteratorNormalCompletion = true ) { var node = _step . value ; if ( node . loc ) { printedLocations . push ( highlightSourceAtLocation ( node . loc . source , getLocation ( node . loc . source , node . loc . start ) ) ) ; } } } catch ( err ) { _didIteratorError = true ; _iteratorError = err ; } finally { try { if ( ! _iteratorNormalCompletion && _iterator . return != null ) { _iterator . return ( ) ; } } finally { if ( _didIteratorError ) { throw _iteratorError ; } } } } else if ( error . source && error . locations ) { var source = error . source ; var _iteratorNormalCompletion2 = true ; var _didIteratorError2 = false ; var _iteratorError2 = undefined ; try { for ( var _iterator2 = error . locations [ Symbol . iterator ] ( ) , _step2 ; ! ( _iteratorNormalCompletion2 = ( _step2 = _iterator2 . next ( ) ) . done ) ; _iteratorNormalCompletion2 = true ) { var location = _step2 . value ; printedLocations . push ( highlightSourceAtLocation ( source , location ) ) ; } } catch ( err ) { _didIteratorError2 = true ; _iteratorError2 = err ; } finally { try { if ( ! _iteratorNormalCompletion2 && _iterator2 . return != null ) { _iterator2 . return ( ) ; } } finally { if ( _didIteratorError2 ) { throw _iteratorError2 ; } } } } return printedLocations . length === 0 ? error . message : [ error . message ] . concat ( printedLocations ) . join ( '\n\n' ) + '\n' ; }
Prints a GraphQLError to a string, representing useful location information
 about the error's position in the source.
Prints a GraphQLError to a string representing useful location information about the error ' s position in the source .