react-reach
Version:
A small library for react to communicate with GraphQL
1 lines • 2.05 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("isomorphic-fetch")):"function"==typeof define&&define.amd?define(["isomorphic-fetch"],t):"object"==typeof exports?exports["react-reach"]=t(require("isomorphic-fetch")):e["react-reach"]=t(e.fetch)}(this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reachWithDispatch=t.reachGraphQL=void 0;var n=r(2),o=r(3);t.reachGraphQL=n.reachGraphQL,t.reachWithDispatch=o.reachWithDispatch},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r,n){return(0,a.default)(e,{method:"POST",headers:{Accept:"application/json","content-type":"application/json",authorization:n},body:(0,c.default)({query:t,queryParams:r})}).then(function(e){return e.json()}).then(function(e){if(e&&e.errors)throw Error(e.errors);return e.data})}Object.defineProperty(t,"__esModule",{value:!0});var i=r(4),c=n(i);t.transport=o;var u=r(7),a=n(u)},function(e,t,r){"use strict";function n(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments[3];return(0,o.transport)(e,t,r,n).then(function(e){return e})}Object.defineProperty(t,"__esModule",{value:!0}),t.reachGraphQL=n;var o=r(1)},function(e,t,r){"use strict";function n(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments[3],i=arguments[4];return(0,o.transport)(e,t,r,n).then(function(e){return function(t){return t(i(e))}})}Object.defineProperty(t,"__esModule",{value:!0}),t.reachWithDispatch=n;var o=r(1)},function(e,t,r){e.exports={"default":r(5),__esModule:!0}},function(e,t,r){var n=r(6);e.exports=function(e){return(n.JSON&&n.JSON.stringify||JSON.stringify).apply(JSON,arguments)}},function(e,t){var r=e.exports={version:"1.2.6"};"number"==typeof __e&&(__e=r)},function(t,r){t.exports=e}])});