text: "use strict";
  
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
  
  exports.__esModule = true;
  exports.defaultOptions = exports.runQuery = void 0;
  
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
  
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
  
  var runQuery = function runQuery(handler, query) {
    return handler(query).then(function (r) {
      if (r.errors) {
        throw new Error(r.errors.join(", "));
      }
  
      return r.data;
    });
  };
  
  exports.runQuery = runQuery;
  var defaultOptions = {
    // Override if you want to manually specify the RSS "generator" tag.
    generator: "GatsbyJS",
    // Run a default query to gather some information about the site.
    query: "\n    {\n      site {\n        siteMetadata {\n          title\n          description\n          siteUrl\n          site_url: siteUrl\n        }\n      }\n    }\n  ",
    // Setup an RSS object, merging on various feed-specific options.
    setup: function setup(_ref) {
      var siteMetadata = _ref.query.site.siteMetadata,
          rest = (0, _objectWithoutPropertiesLoose2["default"])(_ref, ["query"]);
      return (0, _extends2["default"])({}, siteMetadata, {}, rest);
    },
    // Create a default RSS feed. Others may be added by using the format below.
    feeds: [{
      query: "\n      {\n        allMarkdownRemark(\n          limit: 1000,\n          sort: {\n            order: DESC,\n            fields: [frontmatter___date]\n          }\n        ) {\n          edges {\n            node {\n              frontmatter {\n                title\n                date\n              }\n              fields {\n                slug\n              }\n              excerpt\n              html\n            }\n          }\n        }\n      }\n    ",
      // Where we will save the feed generated by this query.
      output: "rss.xml"
    }]
  };
  exports.defaultOptions = defaultOptions;