exports.ids = [7];
exports.modules = {

/***/ "5itS":
/***/ (function(module, exports) {



/***/ }),

/***/ "gjc9":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Graphiql", function() { return Graphiql; });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("F5FC");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var graphiql__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("3oG7");
/* harmony import */ var graphiql__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(graphiql__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _graphiql_toolkit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("uOOL");
/* harmony import */ var _graphiql_toolkit__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_graphiql_toolkit__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _provider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("SFuK");
/* harmony import */ var graphiql_graphiql_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("5itS");
/* harmony import */ var graphiql_graphiql_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(graphiql_graphiql_css__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("cDcd");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _deepcase_hasura_client__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("vv5f");
/* harmony import */ var _deepcase_hasura_client__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_deepcase_hasura_client__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _deepcase_react_hasura_token_context__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("Jc59");
/* harmony import */ var _deepcase_react_hasura_token_context__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_deepcase_react_hasura_token_context__WEBPACK_IMPORTED_MODULE_7__);









function Graphiql({
  defaultQuery,
  onVisualize
}) {
  const token = Object(_deepcase_react_hasura_token_context__WEBPACK_IMPORTED_MODULE_7__["useToken"])() || '';
  const fetcher = Object(react__WEBPACK_IMPORTED_MODULE_5__["useMemo"])(() => {
    return Object(_graphiql_toolkit__WEBPACK_IMPORTED_MODULE_2__["createGraphiQLFetcher"])({
      url: `http${_provider__WEBPACK_IMPORTED_MODULE_3__[/* GRAPHQL_SSL */ "b"] ? 's' : ''}://${_provider__WEBPACK_IMPORTED_MODULE_3__[/* GRAPHQL_PATH */ "a"]}`
    });
  }, []);
  const {
    0: query,
    1: setQuery
  } = Object(react__WEBPACK_IMPORTED_MODULE_5__["useState"])('');
  return /*#__PURE__*/Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__["jsx"])(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
    children: !!fetcher && /*#__PURE__*/Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__["jsx"])(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
      children: /*#__PURE__*/Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__["jsx"])(graphiql__WEBPACK_IMPORTED_MODULE_1___default.a, {
        query: defaultQuery,
        fetcher: fetcher,
        editorTheme: 'dracula',
        headers: JSON.stringify(Object(_deepcase_hasura_client__WEBPACK_IMPORTED_MODULE_6__["generateHeaders"])({
          token: token,
          client: 'deeplinks-graphiql'
        })),
        toolbar: {
          additionalContent: /*#__PURE__*/Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__["jsx"])(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
            children: /*#__PURE__*/Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__["jsx"])(graphiql__WEBPACK_IMPORTED_MODULE_1___default.a.Button, {
              title: "Deep.Visualize",
              label: "Deep.Vizualize",
              onClick: () => onVisualize(query)
            })
          })
        },
        onEditQuery: query => setQuery(query)
      })
    })
  });
}

/***/ })

};;