diff --git a/README.md b/README.md index e3a52e8..816de8a 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Reason bindings for the official [@apollo/react-hooks](https://www.npmjs.com/pac - [useMutation :arrow_up:](#usemutation-arrowup) - [useSubscription :arrow_up:](#usesubscription-arrowup) - [Cache :arrow_up:](#cache-arrowup) + - [Fragment :arrow_up:](#fragment-arrowup) - [Getting it running](#getting-it-running) - [Contributors ✨](#contributors-%e2%9c%a8) @@ -383,6 +384,39 @@ If using directives like `@bsRecord`, `@bsDecoder` or `@bsVariant` in `graphql_p By default, apollo will add field `__typename` to the queries and will use it to normalize data and manipulate cache (see [normalization](https://www.apollographql.com/docs/react/advanced/caching/#normalization)). This field won't exist on parsed reason objects, since it is not included in the actual query you write, but is added by apollo before sending the query. Since `__typename` is crucial for the cache to work correctly, we need to read data from cache in its raw unparsed format, which is achieved with `readQuery` from `ApolloClient.ReadQuery` defined in `reason-apollo`. + +## Fragment [:arrow_up:](#table-of-contents) + +Using [fragments](https://www.apollographql.com/docs/react/data/fragments/). + +Fragments can be defined and used like this: + +```reason +// Fragments.re +module PersonFragment = [%graphql + {| + fragment person on Person { + id + name + age + } +|} +]; + +``` + +```reason +module PersonsQuery = [%graphql +{| + query getAllPersons { + ...Fragments.PersonFragment.Person + } +|} +]; +``` + +See [examples/persons/src/fragments/LoadMoreFragments.re](examples/persons/src/fragments/LoadMoreFragments.re). + ## Getting it running ```sh diff --git a/examples/persons/build/Index.js b/examples/persons/build/Index.js index 59eb5f1..5b27d77 100644 --- a/examples/persons/build/Index.js +++ b/examples/persons/build/Index.js @@ -277,6 +277,102 @@ eval("\n/**\n * Expose `Backoff`.\n */\n\nmodule.exports = Backoff;\n\n/**\n * I /***/ }), +/***/ "./node_modules/bs-platform/lib/es6/belt_Option.js": +/*!*********************************************************!*\ + !*** ./node_modules/bs-platform/lib/es6/belt_Option.js ***! + \*********************************************************/ +/*! exports provided: forEachU, forEach, getExn, mapWithDefaultU, mapWithDefault, mapU, map, flatMapU, flatMap, getWithDefault, isSome, isNone, eqU, eq, cmpU, cmp */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forEachU\", function() { return forEachU; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forEach\", function() { return forEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getExn\", function() { return getExn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mapWithDefaultU\", function() { return mapWithDefaultU; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mapWithDefault\", function() { return mapWithDefault; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mapU\", function() { return mapU; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"map\", function() { return map; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flatMapU\", function() { return flatMapU; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flatMap\", function() { return flatMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getWithDefault\", function() { return getWithDefault; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isSome\", function() { return isSome; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNone\", function() { return isNone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"eqU\", function() { return eqU; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"eq\", function() { return eq; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cmpU\", function() { return cmpU; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cmp\", function() { return cmp; });\n/* harmony import */ var _curry_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./curry.js */ \"./node_modules/bs-platform/lib/es6/curry.js\");\n/* harmony import */ var _caml_option_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./caml_option.js */ \"./node_modules/bs-platform/lib/es6/caml_option.js\");\n\n\n\n\n\nfunction forEachU(opt, f) {\n if (opt !== undefined) {\n return f(_caml_option_js__WEBPACK_IMPORTED_MODULE_1__[\"valFromOption\"](opt));\n }\n \n}\n\nfunction forEach(opt, f) {\n return forEachU(opt, _curry_js__WEBPACK_IMPORTED_MODULE_0__[\"__1\"](f));\n}\n\nfunction getExn(x) {\n if (x !== undefined) {\n return _caml_option_js__WEBPACK_IMPORTED_MODULE_1__[\"valFromOption\"](x);\n }\n throw new Error(\"getExn\");\n}\n\nfunction mapWithDefaultU(opt, $$default, f) {\n if (opt !== undefined) {\n return f(_caml_option_js__WEBPACK_IMPORTED_MODULE_1__[\"valFromOption\"](opt));\n } else {\n return $$default;\n }\n}\n\nfunction mapWithDefault(opt, $$default, f) {\n return mapWithDefaultU(opt, $$default, _curry_js__WEBPACK_IMPORTED_MODULE_0__[\"__1\"](f));\n}\n\nfunction mapU(opt, f) {\n if (opt !== undefined) {\n return _caml_option_js__WEBPACK_IMPORTED_MODULE_1__[\"some\"](f(_caml_option_js__WEBPACK_IMPORTED_MODULE_1__[\"valFromOption\"](opt)));\n }\n \n}\n\nfunction map(opt, f) {\n return mapU(opt, _curry_js__WEBPACK_IMPORTED_MODULE_0__[\"__1\"](f));\n}\n\nfunction flatMapU(opt, f) {\n if (opt !== undefined) {\n return f(_caml_option_js__WEBPACK_IMPORTED_MODULE_1__[\"valFromOption\"](opt));\n }\n \n}\n\nfunction flatMap(opt, f) {\n return flatMapU(opt, _curry_js__WEBPACK_IMPORTED_MODULE_0__[\"__1\"](f));\n}\n\nfunction getWithDefault(opt, $$default) {\n if (opt !== undefined) {\n return _caml_option_js__WEBPACK_IMPORTED_MODULE_1__[\"valFromOption\"](opt);\n } else {\n return $$default;\n }\n}\n\nfunction isSome(param) {\n return param !== undefined;\n}\n\nfunction isNone(x) {\n return x === undefined;\n}\n\nfunction eqU(a, b, f) {\n if (a !== undefined) {\n if (b !== undefined) {\n return f(_caml_option_js__WEBPACK_IMPORTED_MODULE_1__[\"valFromOption\"](a), _caml_option_js__WEBPACK_IMPORTED_MODULE_1__[\"valFromOption\"](b));\n } else {\n return false;\n }\n } else {\n return b === undefined;\n }\n}\n\nfunction eq(a, b, f) {\n return eqU(a, b, _curry_js__WEBPACK_IMPORTED_MODULE_0__[\"__2\"](f));\n}\n\nfunction cmpU(a, b, f) {\n if (a !== undefined) {\n if (b !== undefined) {\n return f(_caml_option_js__WEBPACK_IMPORTED_MODULE_1__[\"valFromOption\"](a), _caml_option_js__WEBPACK_IMPORTED_MODULE_1__[\"valFromOption\"](b));\n } else {\n return 1;\n }\n } else if (b !== undefined) {\n return -1;\n } else {\n return 0;\n }\n}\n\nfunction cmp(a, b, f) {\n return cmpU(a, b, _curry_js__WEBPACK_IMPORTED_MODULE_0__[\"__2\"](f));\n}\n\n\n/* No side effect */\n\n\n//# sourceURL=webpack:///./node_modules/bs-platform/lib/es6/belt_Option.js?"); + +/***/ }), + +/***/ "./node_modules/bs-platform/lib/es6/block.js": +/*!***************************************************!*\ + !*** ./node_modules/bs-platform/lib/es6/block.js ***! + \***************************************************/ +/*! exports provided: __ */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__\", function() { return __; });\n\n\n\nfunction __(tag, block) {\n block.tag = tag;\n return block;\n}\n\n\n/* No side effect */\n\n\n//# sourceURL=webpack:///./node_modules/bs-platform/lib/es6/block.js?"); + +/***/ }), + +/***/ "./node_modules/bs-platform/lib/es6/caml_array.js": +/*!********************************************************!*\ + !*** ./node_modules/bs-platform/lib/es6/caml_array.js ***! + \********************************************************/ +/*! exports provided: caml_array_dup, caml_array_sub, caml_array_concat, caml_make_vect, caml_make_float_vect, caml_array_blit, caml_array_get, caml_array_set */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"caml_array_dup\", function() { return caml_array_dup; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"caml_array_sub\", function() { return caml_array_sub; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"caml_array_concat\", function() { return caml_array_concat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"caml_make_vect\", function() { return caml_make_vect; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"caml_make_float_vect\", function() { return caml_make_float_vect; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"caml_array_blit\", function() { return caml_array_blit; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"caml_array_get\", function() { return caml_array_get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"caml_array_set\", function() { return caml_array_set; });\n/* harmony import */ var _caml_builtin_exceptions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./caml_builtin_exceptions.js */ \"./node_modules/bs-platform/lib/es6/caml_builtin_exceptions.js\");\n\n\n\n\nfunction caml_array_sub(x, offset, len) {\n var result = new Array(len);\n var j = 0;\n var i = offset;\n while(j < len) {\n result[j] = x[i];\n j = j + 1 | 0;\n i = i + 1 | 0;\n };\n return result;\n}\n\nfunction len(_acc, _l) {\n while(true) {\n var l = _l;\n var acc = _acc;\n if (!l) {\n return acc;\n }\n _l = l[1];\n _acc = l[0].length + acc | 0;\n continue ;\n };\n}\n\nfunction fill(arr, _i, _l) {\n while(true) {\n var l = _l;\n var i = _i;\n if (!l) {\n return ;\n }\n var x = l[0];\n var l$1 = x.length;\n var k = i;\n var j = 0;\n while(j < l$1) {\n arr[k] = x[j];\n k = k + 1 | 0;\n j = j + 1 | 0;\n };\n _l = l[1];\n _i = k;\n continue ;\n };\n}\n\nfunction caml_array_concat(l) {\n var v = len(0, l);\n var result = new Array(v);\n fill(result, 0, l);\n return result;\n}\n\nfunction caml_array_set(xs, index, newval) {\n if (index < 0 || index >= xs.length) {\n throw [\n _caml_builtin_exceptions_js__WEBPACK_IMPORTED_MODULE_0__[\"invalid_argument\"],\n \"index out of bounds\"\n ];\n }\n xs[index] = newval;\n \n}\n\nfunction caml_array_get(xs, index) {\n if (index < 0 || index >= xs.length) {\n throw [\n _caml_builtin_exceptions_js__WEBPACK_IMPORTED_MODULE_0__[\"invalid_argument\"],\n \"index out of bounds\"\n ];\n }\n return xs[index];\n}\n\nfunction caml_make_vect(len, init) {\n var b = new Array(len);\n for(var i = 0; i < len; ++i){\n b[i] = init;\n }\n return b;\n}\n\nfunction caml_make_float_vect(len) {\n var b = new Array(len);\n for(var i = 0; i < len; ++i){\n b[i] = 0;\n }\n return b;\n}\n\nfunction caml_array_blit(a1, i1, a2, i2, len) {\n if (i2 <= i1) {\n for(var j = 0; j < len; ++j){\n a2[j + i2 | 0] = a1[j + i1 | 0];\n }\n return ;\n }\n for(var j$1 = len - 1 | 0; j$1 >= 0; --j$1){\n a2[j$1 + i2 | 0] = a1[j$1 + i1 | 0];\n }\n \n}\n\nfunction caml_array_dup(prim) {\n return prim.slice(0);\n}\n\n\n/* No side effect */\n\n\n//# sourceURL=webpack:///./node_modules/bs-platform/lib/es6/caml_array.js?"); + +/***/ }), + +/***/ "./node_modules/bs-platform/lib/es6/caml_builtin_exceptions.js": +/*!*********************************************************************!*\ + !*** ./node_modules/bs-platform/lib/es6/caml_builtin_exceptions.js ***! + \*********************************************************************/ +/*! exports provided: out_of_memory, sys_error, failure, invalid_argument, end_of_file, division_by_zero, not_found, match_failure, stack_overflow, sys_blocked_io, assert_failure, undefined_recursive_module */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"out_of_memory\", function() { return out_of_memory; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sys_error\", function() { return sys_error; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"failure\", function() { return failure; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invalid_argument\", function() { return invalid_argument; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"end_of_file\", function() { return end_of_file; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"division_by_zero\", function() { return division_by_zero; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"not_found\", function() { return not_found; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"match_failure\", function() { return match_failure; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"stack_overflow\", function() { return stack_overflow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sys_blocked_io\", function() { return sys_blocked_io; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"assert_failure\", function() { return assert_failure; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"undefined_recursive_module\", function() { return undefined_recursive_module; });\n\n\n\nvar out_of_memory = /* tuple */[\n \"Out_of_memory\",\n 0\n];\n\nvar sys_error = /* tuple */[\n \"Sys_error\",\n -1\n];\n\nvar failure = /* tuple */[\n \"Failure\",\n -2\n];\n\nvar invalid_argument = /* tuple */[\n \"Invalid_argument\",\n -3\n];\n\nvar end_of_file = /* tuple */[\n \"End_of_file\",\n -4\n];\n\nvar division_by_zero = /* tuple */[\n \"Division_by_zero\",\n -5\n];\n\nvar not_found = /* tuple */[\n \"Not_found\",\n -6\n];\n\nvar match_failure = /* tuple */[\n \"Match_failure\",\n -7\n];\n\nvar stack_overflow = /* tuple */[\n \"Stack_overflow\",\n -8\n];\n\nvar sys_blocked_io = /* tuple */[\n \"Sys_blocked_io\",\n -9\n];\n\nvar assert_failure = /* tuple */[\n \"Assert_failure\",\n -10\n];\n\nvar undefined_recursive_module = /* tuple */[\n \"Undefined_recursive_module\",\n -11\n];\n\nout_of_memory.tag = 248;\n\nsys_error.tag = 248;\n\nfailure.tag = 248;\n\ninvalid_argument.tag = 248;\n\nend_of_file.tag = 248;\n\ndivision_by_zero.tag = 248;\n\nnot_found.tag = 248;\n\nmatch_failure.tag = 248;\n\nstack_overflow.tag = 248;\n\nsys_blocked_io.tag = 248;\n\nassert_failure.tag = 248;\n\nundefined_recursive_module.tag = 248;\n\n\n/* Not a pure module */\n\n\n//# sourceURL=webpack:///./node_modules/bs-platform/lib/es6/caml_builtin_exceptions.js?"); + +/***/ }), + +/***/ "./node_modules/bs-platform/lib/es6/caml_option.js": +/*!*********************************************************!*\ + !*** ./node_modules/bs-platform/lib/es6/caml_option.js ***! + \*********************************************************/ +/*! exports provided: nullable_to_opt, undefined_to_opt, null_to_opt, valFromOption, some, option_get, option_get_unwrap */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"nullable_to_opt\", function() { return nullable_to_opt; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"undefined_to_opt\", function() { return undefined_to_opt; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"null_to_opt\", function() { return null_to_opt; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"valFromOption\", function() { return valFromOption; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"some\", function() { return some; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"option_get\", function() { return option_get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"option_get_unwrap\", function() { return option_get_unwrap; });\n\n\n\nvar undefinedHeader = [];\n\nfunction some(x) {\n if (x === undefined) {\n var block = /* tuple */[\n undefinedHeader,\n 0\n ];\n block.tag = 256;\n return block;\n }\n if (!(x !== null && x[0] === undefinedHeader)) {\n return x;\n }\n var nid = x[1] + 1 | 0;\n var block$1 = /* tuple */[\n undefinedHeader,\n nid\n ];\n block$1.tag = 256;\n return block$1;\n}\n\nfunction nullable_to_opt(x) {\n if (x === null || x === undefined) {\n return ;\n } else {\n return some(x);\n }\n}\n\nfunction undefined_to_opt(x) {\n if (x === undefined) {\n return ;\n } else {\n return some(x);\n }\n}\n\nfunction null_to_opt(x) {\n if (x === null) {\n return ;\n } else {\n return some(x);\n }\n}\n\nfunction valFromOption(x) {\n if (!(x !== null && x[0] === undefinedHeader)) {\n return x;\n }\n var depth = x[1];\n if (depth === 0) {\n return ;\n } else {\n return /* tuple */[\n undefinedHeader,\n depth - 1 | 0\n ];\n }\n}\n\nfunction option_get(x) {\n if (x === undefined) {\n return ;\n } else {\n return valFromOption(x);\n }\n}\n\nfunction option_get_unwrap(x) {\n if (x === undefined) {\n return ;\n } else {\n return valFromOption(x)[1];\n }\n}\n\n\n/* No side effect */\n\n\n//# sourceURL=webpack:///./node_modules/bs-platform/lib/es6/caml_option.js?"); + +/***/ }), + +/***/ "./node_modules/bs-platform/lib/es6/curry.js": +/*!***************************************************!*\ + !*** ./node_modules/bs-platform/lib/es6/curry.js ***! + \***************************************************/ +/*! exports provided: app, _1, __1, _2, __2, _3, __3, _4, __4, _5, __5, _6, __6, _7, __7, _8, __8 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"app\", function() { return app; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_1\", function() { return _1; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__1\", function() { return __1; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_2\", function() { return _2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__2\", function() { return __2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_3\", function() { return _3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__3\", function() { return __3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_4\", function() { return _4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__4\", function() { return __4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_5\", function() { return _5; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__5\", function() { return __5; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_6\", function() { return _6; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__6\", function() { return __6; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_7\", function() { return _7; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__7\", function() { return __7; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_8\", function() { return _8; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__8\", function() { return __8; });\n/* harmony import */ var _caml_array_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./caml_array.js */ \"./node_modules/bs-platform/lib/es6/caml_array.js\");\n\n\n\n\nfunction app(_f, _args) {\n while(true) {\n var args = _args;\n var f = _f;\n var init_arity = f.length;\n var arity = init_arity === 0 ? 1 : init_arity;\n var len = args.length;\n var d = arity - len | 0;\n if (d === 0) {\n return f.apply(null, args);\n }\n if (d >= 0) {\n return (function(f,args){\n return function (x) {\n return app(f, args.concat([x]));\n }\n }(f,args));\n }\n _args = _caml_array_js__WEBPACK_IMPORTED_MODULE_0__[\"caml_array_sub\"](args, arity, -d | 0);\n _f = f.apply(null, _caml_array_js__WEBPACK_IMPORTED_MODULE_0__[\"caml_array_sub\"](args, 0, arity));\n continue ;\n };\n}\n\nfunction _1(o, a0) {\n var arity = o.length;\n if (arity === 1) {\n return o(a0);\n } else {\n switch (arity) {\n case 1 :\n return o(a0);\n case 2 :\n return (function (param) {\n return o(a0, param);\n });\n case 3 :\n return (function (param, param$1) {\n return o(a0, param, param$1);\n });\n case 4 :\n return (function (param, param$1, param$2) {\n return o(a0, param, param$1, param$2);\n });\n case 5 :\n return (function (param, param$1, param$2, param$3) {\n return o(a0, param, param$1, param$2, param$3);\n });\n case 6 :\n return (function (param, param$1, param$2, param$3, param$4) {\n return o(a0, param, param$1, param$2, param$3, param$4);\n });\n case 7 :\n return (function (param, param$1, param$2, param$3, param$4, param$5) {\n return o(a0, param, param$1, param$2, param$3, param$4, param$5);\n });\n default:\n return app(o, [a0]);\n }\n }\n}\n\nfunction __1(o) {\n var arity = o.length;\n if (arity === 1) {\n return o;\n } else {\n return (function (a0) {\n return _1(o, a0);\n });\n }\n}\n\nfunction _2(o, a0, a1) {\n var arity = o.length;\n if (arity === 2) {\n return o(a0, a1);\n } else {\n switch (arity) {\n case 1 :\n return app(o(a0), [a1]);\n case 2 :\n return o(a0, a1);\n case 3 :\n return (function (param) {\n return o(a0, a1, param);\n });\n case 4 :\n return (function (param, param$1) {\n return o(a0, a1, param, param$1);\n });\n case 5 :\n return (function (param, param$1, param$2) {\n return o(a0, a1, param, param$1, param$2);\n });\n case 6 :\n return (function (param, param$1, param$2, param$3) {\n return o(a0, a1, param, param$1, param$2, param$3);\n });\n case 7 :\n return (function (param, param$1, param$2, param$3, param$4) {\n return o(a0, a1, param, param$1, param$2, param$3, param$4);\n });\n default:\n return app(o, [\n a0,\n a1\n ]);\n }\n }\n}\n\nfunction __2(o) {\n var arity = o.length;\n if (arity === 2) {\n return o;\n } else {\n return (function (a0, a1) {\n return _2(o, a0, a1);\n });\n }\n}\n\nfunction _3(o, a0, a1, a2) {\n var arity = o.length;\n if (arity === 3) {\n return o(a0, a1, a2);\n } else {\n switch (arity) {\n case 1 :\n return app(o(a0), [\n a1,\n a2\n ]);\n case 2 :\n return app(o(a0, a1), [a2]);\n case 3 :\n return o(a0, a1, a2);\n case 4 :\n return (function (param) {\n return o(a0, a1, a2, param);\n });\n case 5 :\n return (function (param, param$1) {\n return o(a0, a1, a2, param, param$1);\n });\n case 6 :\n return (function (param, param$1, param$2) {\n return o(a0, a1, a2, param, param$1, param$2);\n });\n case 7 :\n return (function (param, param$1, param$2, param$3) {\n return o(a0, a1, a2, param, param$1, param$2, param$3);\n });\n default:\n return app(o, [\n a0,\n a1,\n a2\n ]);\n }\n }\n}\n\nfunction __3(o) {\n var arity = o.length;\n if (arity === 3) {\n return o;\n } else {\n return (function (a0, a1, a2) {\n return _3(o, a0, a1, a2);\n });\n }\n}\n\nfunction _4(o, a0, a1, a2, a3) {\n var arity = o.length;\n if (arity === 4) {\n return o(a0, a1, a2, a3);\n } else {\n switch (arity) {\n case 1 :\n return app(o(a0), [\n a1,\n a2,\n a3\n ]);\n case 2 :\n return app(o(a0, a1), [\n a2,\n a3\n ]);\n case 3 :\n return app(o(a0, a1, a2), [a3]);\n case 4 :\n return o(a0, a1, a2, a3);\n case 5 :\n return (function (param) {\n return o(a0, a1, a2, a3, param);\n });\n case 6 :\n return (function (param, param$1) {\n return o(a0, a1, a2, a3, param, param$1);\n });\n case 7 :\n return (function (param, param$1, param$2) {\n return o(a0, a1, a2, a3, param, param$1, param$2);\n });\n default:\n return app(o, [\n a0,\n a1,\n a2,\n a3\n ]);\n }\n }\n}\n\nfunction __4(o) {\n var arity = o.length;\n if (arity === 4) {\n return o;\n } else {\n return (function (a0, a1, a2, a3) {\n return _4(o, a0, a1, a2, a3);\n });\n }\n}\n\nfunction _5(o, a0, a1, a2, a3, a4) {\n var arity = o.length;\n if (arity === 5) {\n return o(a0, a1, a2, a3, a4);\n } else {\n switch (arity) {\n case 1 :\n return app(o(a0), [\n a1,\n a2,\n a3,\n a4\n ]);\n case 2 :\n return app(o(a0, a1), [\n a2,\n a3,\n a4\n ]);\n case 3 :\n return app(o(a0, a1, a2), [\n a3,\n a4\n ]);\n case 4 :\n return app(o(a0, a1, a2, a3), [a4]);\n case 5 :\n return o(a0, a1, a2, a3, a4);\n case 6 :\n return (function (param) {\n return o(a0, a1, a2, a3, a4, param);\n });\n case 7 :\n return (function (param, param$1) {\n return o(a0, a1, a2, a3, a4, param, param$1);\n });\n default:\n return app(o, [\n a0,\n a1,\n a2,\n a3,\n a4\n ]);\n }\n }\n}\n\nfunction __5(o) {\n var arity = o.length;\n if (arity === 5) {\n return o;\n } else {\n return (function (a0, a1, a2, a3, a4) {\n return _5(o, a0, a1, a2, a3, a4);\n });\n }\n}\n\nfunction _6(o, a0, a1, a2, a3, a4, a5) {\n var arity = o.length;\n if (arity === 6) {\n return o(a0, a1, a2, a3, a4, a5);\n } else {\n switch (arity) {\n case 1 :\n return app(o(a0), [\n a1,\n a2,\n a3,\n a4,\n a5\n ]);\n case 2 :\n return app(o(a0, a1), [\n a2,\n a3,\n a4,\n a5\n ]);\n case 3 :\n return app(o(a0, a1, a2), [\n a3,\n a4,\n a5\n ]);\n case 4 :\n return app(o(a0, a1, a2, a3), [\n a4,\n a5\n ]);\n case 5 :\n return app(o(a0, a1, a2, a3, a4), [a5]);\n case 6 :\n return o(a0, a1, a2, a3, a4, a5);\n case 7 :\n return (function (param) {\n return o(a0, a1, a2, a3, a4, a5, param);\n });\n default:\n return app(o, [\n a0,\n a1,\n a2,\n a3,\n a4,\n a5\n ]);\n }\n }\n}\n\nfunction __6(o) {\n var arity = o.length;\n if (arity === 6) {\n return o;\n } else {\n return (function (a0, a1, a2, a3, a4, a5) {\n return _6(o, a0, a1, a2, a3, a4, a5);\n });\n }\n}\n\nfunction _7(o, a0, a1, a2, a3, a4, a5, a6) {\n var arity = o.length;\n if (arity === 7) {\n return o(a0, a1, a2, a3, a4, a5, a6);\n } else {\n switch (arity) {\n case 1 :\n return app(o(a0), [\n a1,\n a2,\n a3,\n a4,\n a5,\n a6\n ]);\n case 2 :\n return app(o(a0, a1), [\n a2,\n a3,\n a4,\n a5,\n a6\n ]);\n case 3 :\n return app(o(a0, a1, a2), [\n a3,\n a4,\n a5,\n a6\n ]);\n case 4 :\n return app(o(a0, a1, a2, a3), [\n a4,\n a5,\n a6\n ]);\n case 5 :\n return app(o(a0, a1, a2, a3, a4), [\n a5,\n a6\n ]);\n case 6 :\n return app(o(a0, a1, a2, a3, a4, a5), [a6]);\n case 7 :\n return o(a0, a1, a2, a3, a4, a5, a6);\n default:\n return app(o, [\n a0,\n a1,\n a2,\n a3,\n a4,\n a5,\n a6\n ]);\n }\n }\n}\n\nfunction __7(o) {\n var arity = o.length;\n if (arity === 7) {\n return o;\n } else {\n return (function (a0, a1, a2, a3, a4, a5, a6) {\n return _7(o, a0, a1, a2, a3, a4, a5, a6);\n });\n }\n}\n\nfunction _8(o, a0, a1, a2, a3, a4, a5, a6, a7) {\n var arity = o.length;\n if (arity === 8) {\n return o(a0, a1, a2, a3, a4, a5, a6, a7);\n } else {\n switch (arity) {\n case 1 :\n return app(o(a0), [\n a1,\n a2,\n a3,\n a4,\n a5,\n a6,\n a7\n ]);\n case 2 :\n return app(o(a0, a1), [\n a2,\n a3,\n a4,\n a5,\n a6,\n a7\n ]);\n case 3 :\n return app(o(a0, a1, a2), [\n a3,\n a4,\n a5,\n a6,\n a7\n ]);\n case 4 :\n return app(o(a0, a1, a2, a3), [\n a4,\n a5,\n a6,\n a7\n ]);\n case 5 :\n return app(o(a0, a1, a2, a3, a4), [\n a5,\n a6,\n a7\n ]);\n case 6 :\n return app(o(a0, a1, a2, a3, a4, a5), [\n a6,\n a7\n ]);\n case 7 :\n return app(o(a0, a1, a2, a3, a4, a5, a6), [a7]);\n default:\n return app(o, [\n a0,\n a1,\n a2,\n a3,\n a4,\n a5,\n a6,\n a7\n ]);\n }\n }\n}\n\nfunction __8(o) {\n var arity = o.length;\n if (arity === 8) {\n return o;\n } else {\n return (function (a0, a1, a2, a3, a4, a5, a6, a7) {\n return _8(o, a0, a1, a2, a3, a4, a5, a6, a7);\n });\n }\n}\n\n\n/* No side effect */\n\n\n//# sourceURL=webpack:///./node_modules/bs-platform/lib/es6/curry.js?"); + +/***/ }), + +/***/ "./node_modules/bs-platform/lib/es6/js_json.js": +/*!*****************************************************!*\ + !*** ./node_modules/bs-platform/lib/es6/js_json.js ***! + \*****************************************************/ +/*! exports provided: classify, test, decodeString, decodeNumber, decodeObject, decodeArray, decodeBoolean, decodeNull */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"classify\", function() { return classify; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"test\", function() { return test; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decodeString\", function() { return decodeString; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decodeNumber\", function() { return decodeNumber; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decodeObject\", function() { return decodeObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decodeArray\", function() { return decodeArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decodeBoolean\", function() { return decodeBoolean; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decodeNull\", function() { return decodeNull; });\n/* harmony import */ var _block_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./block.js */ \"./node_modules/bs-platform/lib/es6/block.js\");\n/* harmony import */ var _caml_option_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./caml_option.js */ \"./node_modules/bs-platform/lib/es6/caml_option.js\");\n\n\n\n\n\nfunction classify(x) {\n var ty = typeof x;\n if (ty === \"string\") {\n return /* JSONString */_block_js__WEBPACK_IMPORTED_MODULE_0__[\"__\"](0, [x]);\n } else if (ty === \"number\") {\n return /* JSONNumber */_block_js__WEBPACK_IMPORTED_MODULE_0__[\"__\"](1, [x]);\n } else if (ty === \"boolean\") {\n if (x === true) {\n return /* JSONTrue */1;\n } else {\n return /* JSONFalse */0;\n }\n } else if (x === null) {\n return /* JSONNull */2;\n } else if (Array.isArray(x)) {\n return /* JSONArray */_block_js__WEBPACK_IMPORTED_MODULE_0__[\"__\"](3, [x]);\n } else {\n return /* JSONObject */_block_js__WEBPACK_IMPORTED_MODULE_0__[\"__\"](2, [x]);\n }\n}\n\nfunction test(x, v) {\n switch (v) {\n case /* String */0 :\n return typeof x === \"string\";\n case /* Number */1 :\n return typeof x === \"number\";\n case /* Object */2 :\n if (x !== null && typeof x === \"object\") {\n return !Array.isArray(x);\n } else {\n return false;\n }\n case /* Array */3 :\n return Array.isArray(x);\n case /* Boolean */4 :\n return typeof x === \"boolean\";\n case /* Null */5 :\n return x === null;\n \n }\n}\n\nfunction decodeString(json) {\n if (typeof json === \"string\") {\n return json;\n }\n \n}\n\nfunction decodeNumber(json) {\n if (typeof json === \"number\") {\n return json;\n }\n \n}\n\nfunction decodeObject(json) {\n if (typeof json === \"object\" && !Array.isArray(json) && json !== null) {\n return _caml_option_js__WEBPACK_IMPORTED_MODULE_1__[\"some\"](json);\n }\n \n}\n\nfunction decodeArray(json) {\n if (Array.isArray(json)) {\n return json;\n }\n \n}\n\nfunction decodeBoolean(json) {\n if (typeof json === \"boolean\") {\n return json;\n }\n \n}\n\nfunction decodeNull(json) {\n if (json === null) {\n return null;\n }\n \n}\n\n\n/* No side effect */\n\n\n//# sourceURL=webpack:///./node_modules/bs-platform/lib/es6/js_json.js?"); + +/***/ }), + +/***/ "./node_modules/bs-platform/lib/es6/js_null_undefined.js": +/*!***************************************************************!*\ + !*** ./node_modules/bs-platform/lib/es6/js_null_undefined.js ***! + \***************************************************************/ +/*! exports provided: bind, iter, fromOption, from_opt */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bind\", function() { return bind; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"iter\", function() { return iter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromOption\", function() { return fromOption; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"from_opt\", function() { return from_opt; });\n/* harmony import */ var _caml_option_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./caml_option.js */ \"./node_modules/bs-platform/lib/es6/caml_option.js\");\n\n\n\n\nfunction bind(x, f) {\n if (x == null) {\n return x;\n } else {\n return f(x);\n }\n}\n\nfunction iter(x, f) {\n if (!(x == null)) {\n return f(x);\n }\n \n}\n\nfunction fromOption(x) {\n if (x !== undefined) {\n return _caml_option_js__WEBPACK_IMPORTED_MODULE_0__[\"valFromOption\"](x);\n }\n \n}\n\nvar from_opt = fromOption;\n\n\n/* No side effect */\n\n\n//# sourceURL=webpack:///./node_modules/bs-platform/lib/es6/js_null_undefined.js?"); + +/***/ }), + /***/ "./node_modules/bs-platform/lib/js/belt_Array.js": /*!*******************************************************!*\ !*** ./node_modules/bs-platform/lib/js/belt_Array.js ***! @@ -1140,11 +1236,11 @@ eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar Js_dict = __w /*!***********************************************************!*\ !*** ./node_modules/reason-apollo/src/ApolloClient.bs.js ***! \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/*! exports provided: ReadQuery, WriteQuery */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar Belt_Option = __webpack_require__(/*! bs-platform/lib/js/belt_Option.js */ \"./node_modules/bs-platform/lib/js/belt_Option.js\");\nvar Caml_option = __webpack_require__(/*! bs-platform/lib/js/caml_option.js */ \"./node_modules/bs-platform/lib/js/caml_option.js\");\nvar GraphqlTag = __webpack_require__(/*! graphql-tag */ \"./node_modules/graphql-tag/src/index.js\");\nvar Js_null_undefined = __webpack_require__(/*! bs-platform/lib/js/js_null_undefined.js */ \"./node_modules/bs-platform/lib/js/js_null_undefined.js\");\n\nfunction ReadQuery(Config) {\n var graphqlQueryAST = GraphqlTag.default(Config.query);\n var apolloDataToRecord = function (apolloData) {\n return Belt_Option.map((apolloData == null) ? undefined : Caml_option.some(apolloData), Config.parse);\n };\n var make = function (client, variables, param) {\n var apolloData = client.readQuery({\n query: graphqlQueryAST,\n variables: Js_null_undefined.fromOption(variables)\n });\n return Belt_Option.map((apolloData == null) ? undefined : Caml_option.some(apolloData), Config.parse);\n };\n return {\n graphqlQueryAST: graphqlQueryAST,\n apolloDataToRecord: apolloDataToRecord,\n make: make\n };\n}\n\nfunction WriteQuery(Config) {\n var graphqlQueryAST = GraphqlTag.default(Config.query);\n var make = function (client, variables, data, param) {\n client.writeQuery({\n query: graphqlQueryAST,\n variables: Js_null_undefined.fromOption(variables),\n data: data\n });\n \n };\n return {\n graphqlQueryAST: graphqlQueryAST,\n make: make\n };\n}\n\nexports.ReadQuery = ReadQuery;\nexports.WriteQuery = WriteQuery;\n/* graphql-tag Not a pure module */\n\n\n//# sourceURL=webpack:///./node_modules/reason-apollo/src/ApolloClient.bs.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ReadQuery\", function() { return ReadQuery; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WriteQuery\", function() { return WriteQuery; });\n/* harmony import */ var bs_platform_lib_es6_belt_Option_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! bs-platform/lib/es6/belt_Option.js */ \"./node_modules/bs-platform/lib/es6/belt_Option.js\");\n/* harmony import */ var bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! bs-platform/lib/es6/caml_option.js */ \"./node_modules/bs-platform/lib/es6/caml_option.js\");\n/* harmony import */ var graphql_tag__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! graphql-tag */ \"./node_modules/graphql-tag/src/index.js\");\n/* harmony import */ var graphql_tag__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(graphql_tag__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var bs_platform_lib_es6_js_null_undefined_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! bs-platform/lib/es6/js_null_undefined.js */ \"./node_modules/bs-platform/lib/es6/js_null_undefined.js\");\n// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\n\n\n\n\nfunction ReadQuery(Config) {\n var graphqlQueryAST = graphql_tag__WEBPACK_IMPORTED_MODULE_2___default.a(Config.query);\n var apolloDataToRecord = function (apolloData) {\n return bs_platform_lib_es6_belt_Option_js__WEBPACK_IMPORTED_MODULE_0__[\"map\"]((apolloData == null) ? undefined : bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_1__[\"some\"](apolloData), Config.parse);\n };\n var make = function (client, variables, param) {\n var apolloData = client.readQuery({\n query: graphqlQueryAST,\n variables: bs_platform_lib_es6_js_null_undefined_js__WEBPACK_IMPORTED_MODULE_3__[\"fromOption\"](variables)\n });\n return bs_platform_lib_es6_belt_Option_js__WEBPACK_IMPORTED_MODULE_0__[\"map\"]((apolloData == null) ? undefined : bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_1__[\"some\"](apolloData), Config.parse);\n };\n return {\n graphqlQueryAST: graphqlQueryAST,\n apolloDataToRecord: apolloDataToRecord,\n make: make\n };\n}\n\nfunction WriteQuery(Config) {\n var graphqlQueryAST = graphql_tag__WEBPACK_IMPORTED_MODULE_2___default.a(Config.query);\n var make = function (client, variables, data, param) {\n client.writeQuery({\n query: graphqlQueryAST,\n variables: bs_platform_lib_es6_js_null_undefined_js__WEBPACK_IMPORTED_MODULE_3__[\"fromOption\"](variables),\n data: data\n });\n return /* () */0;\n };\n return {\n graphqlQueryAST: graphqlQueryAST,\n make: make\n };\n}\n\n\n/* graphql-tag Not a pure module */\n\n\n//# sourceURL=webpack:///./node_modules/reason-apollo/src/ApolloClient.bs.js?"); /***/ }), @@ -1152,11 +1248,11 @@ eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar Belt_Option = /*!******************************************************************!*\ !*** ./node_modules/reason-apollo/src/ApolloInMemoryCache.bs.js ***! \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/*! exports provided: createIntrospectionFragmentMatcher, createInMemoryCache */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar Caml_option = __webpack_require__(/*! bs-platform/lib/js/caml_option.js */ \"./node_modules/bs-platform/lib/js/caml_option.js\");\nvar ApolloCacheInmemory = __webpack_require__(/*! apollo-cache-inmemory */ \"./node_modules/apollo-cache-inmemory/lib/bundle.esm.js\");\n\nfunction createIntrospectionFragmentMatcher(data) {\n return new ApolloCacheInmemory.IntrospectionFragmentMatcher({\n introspectionQueryResultData: data\n });\n}\n\nfunction createInMemoryCache(dataIdFromObject, fragmentMatcher, param) {\n var tmp = { };\n if (dataIdFromObject !== undefined) {\n tmp.dataIdFromObject = Caml_option.valFromOption(dataIdFromObject);\n }\n if (fragmentMatcher !== undefined) {\n tmp.fragmentMatcher = Caml_option.valFromOption(fragmentMatcher);\n }\n return new ApolloCacheInmemory.InMemoryCache(tmp);\n}\n\nexports.createIntrospectionFragmentMatcher = createIntrospectionFragmentMatcher;\nexports.createInMemoryCache = createInMemoryCache;\n/* apollo-cache-inmemory Not a pure module */\n\n\n//# sourceURL=webpack:///./node_modules/reason-apollo/src/ApolloInMemoryCache.bs.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createIntrospectionFragmentMatcher\", function() { return createIntrospectionFragmentMatcher; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createInMemoryCache\", function() { return createInMemoryCache; });\n/* harmony import */ var bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! bs-platform/lib/es6/caml_option.js */ \"./node_modules/bs-platform/lib/es6/caml_option.js\");\n/* harmony import */ var apollo_cache_inmemory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! apollo-cache-inmemory */ \"./node_modules/apollo-cache-inmemory/lib/bundle.esm.js\");\n// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\n\n\nfunction createIntrospectionFragmentMatcher(data) {\n return new apollo_cache_inmemory__WEBPACK_IMPORTED_MODULE_1__[\"IntrospectionFragmentMatcher\"]({\n introspectionQueryResultData: data\n });\n}\n\nfunction createInMemoryCache(dataIdFromObject, fragmentMatcher, param) {\n var tmp = { };\n if (dataIdFromObject !== undefined) {\n tmp.dataIdFromObject = bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_0__[\"valFromOption\"](dataIdFromObject);\n }\n if (fragmentMatcher !== undefined) {\n tmp.fragmentMatcher = bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_0__[\"valFromOption\"](fragmentMatcher);\n }\n return new apollo_cache_inmemory__WEBPACK_IMPORTED_MODULE_1__[\"InMemoryCache\"](tmp);\n}\n\n\n/* apollo-cache-inmemory Not a pure module */\n\n\n//# sourceURL=webpack:///./node_modules/reason-apollo/src/ApolloInMemoryCache.bs.js?"); /***/ }), @@ -1164,11 +1260,11 @@ eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar Caml_option = /*!**********************************************************!*\ !*** ./node_modules/reason-apollo/src/ApolloLinks.bs.js ***! \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/*! exports provided: createHttpLink, createUploadLink, createContextLink, createErrorLink */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar ApolloLinkHttp = __webpack_require__(/*! apollo-link-http */ \"./node_modules/apollo-link-http/lib/bundle.esm.js\");\nvar Js_null_undefined = __webpack_require__(/*! bs-platform/lib/js/js_null_undefined.js */ \"./node_modules/bs-platform/lib/js/js_null_undefined.js\");\nvar ApolloLinkError = __webpack_require__(/*! apollo-link-error */ \"./node_modules/apollo-link-error/lib/bundle.esm.js\");\nvar ApolloLinkContext = __webpack_require__(/*! apollo-link-context */ \"./node_modules/apollo-link-context/lib/bundle.esm.js\");\nvar ApolloUploadClient = __webpack_require__(/*! apollo-upload-client */ \"./node_modules/apollo-upload-client/lib/index.js\");\n\nfunction createHttpLink(uri, includeExtensions, $$fetch, headers, credentials, fetchOptions, param) {\n return new ApolloLinkHttp.HttpLink({\n uri: uri,\n includeExtensions: Js_null_undefined.fromOption(includeExtensions),\n fetch: Js_null_undefined.fromOption($$fetch),\n headers: Js_null_undefined.fromOption(headers),\n credentials: Js_null_undefined.fromOption(credentials),\n fetchOptions: Js_null_undefined.fromOption(fetchOptions)\n });\n}\n\nfunction createUploadLink(uri, $$fetch, fetchOptions, credentials, headers, includeExtensions, param) {\n return ApolloUploadClient.createUploadLink({\n uri: Js_null_undefined.fromOption(uri),\n fetch: Js_null_undefined.fromOption($$fetch),\n fetchOptions: Js_null_undefined.fromOption(fetchOptions),\n credentials: Js_null_undefined.fromOption(credentials),\n headers: Js_null_undefined.fromOption(headers),\n includeExtensions: Js_null_undefined.fromOption(includeExtensions)\n });\n}\n\nfunction createContextLink(contextHandler) {\n return ApolloLinkContext.setContext(contextHandler);\n}\n\nfunction createErrorLink(errorHandler) {\n return ApolloLinkError.onError(errorHandler);\n}\n\nexports.createHttpLink = createHttpLink;\nexports.createUploadLink = createUploadLink;\nexports.createContextLink = createContextLink;\nexports.createErrorLink = createErrorLink;\n/* apollo-link-http Not a pure module */\n\n\n//# sourceURL=webpack:///./node_modules/reason-apollo/src/ApolloLinks.bs.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createHttpLink\", function() { return createHttpLink; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createUploadLink\", function() { return createUploadLink; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createContextLink\", function() { return createContextLink; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createErrorLink\", function() { return createErrorLink; });\n/* harmony import */ var apollo_link_http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! apollo-link-http */ \"./node_modules/apollo-link-http/lib/bundle.esm.js\");\n/* harmony import */ var bs_platform_lib_es6_js_null_undefined_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! bs-platform/lib/es6/js_null_undefined.js */ \"./node_modules/bs-platform/lib/es6/js_null_undefined.js\");\n/* harmony import */ var apollo_link_error__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! apollo-link-error */ \"./node_modules/apollo-link-error/lib/bundle.esm.js\");\n/* harmony import */ var apollo_link_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! apollo-link-context */ \"./node_modules/apollo-link-context/lib/bundle.esm.js\");\n/* harmony import */ var apollo_upload_client__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! apollo-upload-client */ \"./node_modules/apollo-upload-client/lib/index.js\");\n/* harmony import */ var apollo_upload_client__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(apollo_upload_client__WEBPACK_IMPORTED_MODULE_4__);\n// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\n\n\n\n\n\nfunction createHttpLink(uri, includeExtensions, $$fetch, headers, credentials, fetchOptions, param) {\n return new apollo_link_http__WEBPACK_IMPORTED_MODULE_0__[\"HttpLink\"]({\n uri: uri,\n includeExtensions: bs_platform_lib_es6_js_null_undefined_js__WEBPACK_IMPORTED_MODULE_1__[\"fromOption\"](includeExtensions),\n fetch: bs_platform_lib_es6_js_null_undefined_js__WEBPACK_IMPORTED_MODULE_1__[\"fromOption\"]($$fetch),\n headers: bs_platform_lib_es6_js_null_undefined_js__WEBPACK_IMPORTED_MODULE_1__[\"fromOption\"](headers),\n credentials: bs_platform_lib_es6_js_null_undefined_js__WEBPACK_IMPORTED_MODULE_1__[\"fromOption\"](credentials),\n fetchOptions: bs_platform_lib_es6_js_null_undefined_js__WEBPACK_IMPORTED_MODULE_1__[\"fromOption\"](fetchOptions)\n });\n}\n\nfunction createUploadLink(uri, $$fetch, fetchOptions, credentials, headers, includeExtensions, param) {\n return apollo_upload_client__WEBPACK_IMPORTED_MODULE_4__[\"createUploadLink\"]({\n uri: bs_platform_lib_es6_js_null_undefined_js__WEBPACK_IMPORTED_MODULE_1__[\"fromOption\"](uri),\n fetch: bs_platform_lib_es6_js_null_undefined_js__WEBPACK_IMPORTED_MODULE_1__[\"fromOption\"]($$fetch),\n fetchOptions: bs_platform_lib_es6_js_null_undefined_js__WEBPACK_IMPORTED_MODULE_1__[\"fromOption\"](fetchOptions),\n credentials: bs_platform_lib_es6_js_null_undefined_js__WEBPACK_IMPORTED_MODULE_1__[\"fromOption\"](credentials),\n headers: bs_platform_lib_es6_js_null_undefined_js__WEBPACK_IMPORTED_MODULE_1__[\"fromOption\"](headers),\n includeExtensions: bs_platform_lib_es6_js_null_undefined_js__WEBPACK_IMPORTED_MODULE_1__[\"fromOption\"](includeExtensions)\n });\n}\n\nfunction createContextLink(contextHandler) {\n return apollo_link_context__WEBPACK_IMPORTED_MODULE_3__[\"setContext\"](contextHandler);\n}\n\nfunction createErrorLink(errorHandler) {\n return apollo_link_error__WEBPACK_IMPORTED_MODULE_2__[\"onError\"](errorHandler);\n}\n\n\n/* apollo-link-http Not a pure module */\n\n\n//# sourceURL=webpack:///./node_modules/reason-apollo/src/ApolloLinks.bs.js?"); /***/ }), @@ -1176,11 +1272,11 @@ eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar ApolloLinkHtt /*!***********************************************************!*\ !*** ./node_modules/reason-apollo/src/ReasonApollo.bs.js ***! \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/*! exports provided: createApolloClient, CreateQuery, CreateMutation, CreateSubscription, Provider, Consumer */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar ApolloClient = __webpack_require__(/*! apollo-client */ \"./node_modules/apollo-client/bundle.esm.js\");\nvar ReasonApolloQuery = __webpack_require__(/*! ./graphql-types/ReasonApolloQuery.bs.js */ \"./node_modules/reason-apollo/src/graphql-types/ReasonApolloQuery.bs.js\");\nvar ReasonApolloMutation = __webpack_require__(/*! ./graphql-types/ReasonApolloMutation.bs.js */ \"./node_modules/reason-apollo/src/graphql-types/ReasonApolloMutation.bs.js\");\nvar ReasonApolloSubscription = __webpack_require__(/*! ./graphql-types/ReasonApolloSubscription.bs.js */ \"./node_modules/reason-apollo/src/graphql-types/ReasonApolloSubscription.bs.js\");\n\nfunction createApolloClient(link, cache, ssrMode, ssrForceFetchDelay, connectToDevTools, queryDeduplication, param) {\n return new ApolloClient.ApolloClient({\n link: link,\n cache: cache,\n ssrMode: ssrMode,\n ssrForceFetchDelay: ssrForceFetchDelay,\n connectToDevTools: connectToDevTools,\n queryDeduplication: queryDeduplication\n });\n}\n\nvar CreateQuery = ReasonApolloQuery.Make;\n\nvar CreateMutation = ReasonApolloMutation.Make;\n\nvar CreateSubscription = ReasonApolloSubscription.Make;\n\nvar Provider;\n\nvar Consumer;\n\nexports.createApolloClient = createApolloClient;\nexports.CreateQuery = CreateQuery;\nexports.CreateMutation = CreateMutation;\nexports.CreateSubscription = CreateSubscription;\nexports.Provider = Provider;\nexports.Consumer = Consumer;\n/* apollo-client Not a pure module */\n\n\n//# sourceURL=webpack:///./node_modules/reason-apollo/src/ReasonApollo.bs.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createApolloClient\", function() { return createApolloClient; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CreateQuery\", function() { return CreateQuery; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CreateMutation\", function() { return CreateMutation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CreateSubscription\", function() { return CreateSubscription; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Provider\", function() { return Provider; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Consumer\", function() { return Consumer; });\n/* harmony import */ var apollo_client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! apollo-client */ \"./node_modules/apollo-client/bundle.esm.js\");\n/* harmony import */ var _graphql_types_ReasonApolloQuery_bs_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./graphql-types/ReasonApolloQuery.bs.js */ \"./node_modules/reason-apollo/src/graphql-types/ReasonApolloQuery.bs.js\");\n/* harmony import */ var _graphql_types_ReasonApolloMutation_bs_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./graphql-types/ReasonApolloMutation.bs.js */ \"./node_modules/reason-apollo/src/graphql-types/ReasonApolloMutation.bs.js\");\n/* harmony import */ var _graphql_types_ReasonApolloSubscription_bs_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./graphql-types/ReasonApolloSubscription.bs.js */ \"./node_modules/reason-apollo/src/graphql-types/ReasonApolloSubscription.bs.js\");\n// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\n\n\n\n\nfunction createApolloClient(link, cache, ssrMode, ssrForceFetchDelay, connectToDevTools, queryDeduplication, param) {\n return new apollo_client__WEBPACK_IMPORTED_MODULE_0__[\"ApolloClient\"]({\n link: link,\n cache: cache,\n ssrMode: ssrMode,\n ssrForceFetchDelay: ssrForceFetchDelay,\n connectToDevTools: connectToDevTools,\n queryDeduplication: queryDeduplication\n });\n}\n\nvar CreateQuery = _graphql_types_ReasonApolloQuery_bs_js__WEBPACK_IMPORTED_MODULE_1__[\"Make\"];\n\nvar CreateMutation = _graphql_types_ReasonApolloMutation_bs_js__WEBPACK_IMPORTED_MODULE_2__[\"Make\"];\n\nvar CreateSubscription = _graphql_types_ReasonApolloSubscription_bs_js__WEBPACK_IMPORTED_MODULE_3__[\"Make\"];\n\nvar Provider = /* alias */0;\n\nvar Consumer = /* alias */0;\n\n\n/* apollo-client Not a pure module */\n\n\n//# sourceURL=webpack:///./node_modules/reason-apollo/src/ReasonApollo.bs.js?"); /***/ }), @@ -1188,11 +1284,11 @@ eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar ApolloClient /*!****************************************************************!*\ !*** ./node_modules/reason-apollo/src/ReasonApolloUtils.bs.js ***! \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/*! exports provided: getNonEmptyObj */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar Js_json = __webpack_require__(/*! bs-platform/lib/js/js_json.js */ \"./node_modules/bs-platform/lib/js/js_json.js\");\nvar Caml_option = __webpack_require__(/*! bs-platform/lib/js/caml_option.js */ \"./node_modules/bs-platform/lib/js/caml_option.js\");\n\nfunction getNonEmptyObj(jsObj) {\n if (jsObj == null) {\n return ;\n }\n var data = Js_json.decodeObject(jsObj);\n if (data === undefined) {\n return ;\n }\n var data$1 = Caml_option.valFromOption(data);\n var match = Object.keys(data$1).length;\n if (match !== 0) {\n return Caml_option.some(data$1);\n }\n \n}\n\nexports.getNonEmptyObj = getNonEmptyObj;\n/* No side effect */\n\n\n//# sourceURL=webpack:///./node_modules/reason-apollo/src/ReasonApolloUtils.bs.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getNonEmptyObj\", function() { return getNonEmptyObj; });\n/* harmony import */ var bs_platform_lib_es6_js_json_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! bs-platform/lib/es6/js_json.js */ \"./node_modules/bs-platform/lib/es6/js_json.js\");\n/* harmony import */ var bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! bs-platform/lib/es6/caml_option.js */ \"./node_modules/bs-platform/lib/es6/caml_option.js\");\n// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\n\n\nfunction getNonEmptyObj(jsObj) {\n if (jsObj == null) {\n return ;\n } else {\n var match = bs_platform_lib_es6_js_json_js__WEBPACK_IMPORTED_MODULE_0__[\"decodeObject\"](jsObj);\n if (match !== undefined) {\n var data = bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_1__[\"valFromOption\"](match);\n var match$1 = Object.keys(data).length;\n if (match$1 !== 0) {\n return bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_1__[\"some\"](data);\n } else {\n return ;\n }\n } else {\n return ;\n }\n }\n}\n\n\n/* No side effect */\n\n\n//# sourceURL=webpack:///./node_modules/reason-apollo/src/ReasonApolloUtils.bs.js?"); /***/ }), @@ -1200,11 +1296,11 @@ eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar Js_json = __w /*!*********************************************************************************!*\ !*** ./node_modules/reason-apollo/src/graphql-types/ReasonApolloMutation.bs.js ***! \*********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/*! exports provided: Make */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar Block = __webpack_require__(/*! bs-platform/lib/js/block.js */ \"./node_modules/bs-platform/lib/js/block.js\");\nvar Curry = __webpack_require__(/*! bs-platform/lib/js/curry.js */ \"./node_modules/bs-platform/lib/js/curry.js\");\nvar React = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\nvar Caml_option = __webpack_require__(/*! bs-platform/lib/js/caml_option.js */ \"./node_modules/bs-platform/lib/js/caml_option.js\");\nvar GraphqlTag = __webpack_require__(/*! graphql-tag */ \"./node_modules/graphql-tag/src/index.js\");\nvar ReactApollo = __webpack_require__(/*! react-apollo */ \"./node_modules/react-apollo/react-apollo.esm.js\");\nvar ReasonApolloUtils = __webpack_require__(/*! ../ReasonApolloUtils.bs.js */ \"./node_modules/reason-apollo/src/ReasonApolloUtils.bs.js\");\n\nfunction Make(Config) {\n var graphqlMutationAST = GraphqlTag.default(Config.query);\n var convertExecutionResultToReason = function (executionResult) {\n var match = ReasonApolloUtils.getNonEmptyObj(executionResult.data);\n var match$1 = executionResult.errors;\n if (match !== undefined) {\n return /* Data */Block.__(1, [Curry._1(Config.parse, Caml_option.valFromOption(match))]);\n } else if (!(match$1 == null)) {\n return /* Errors */Block.__(0, [match$1]);\n } else {\n return /* EmptyResponse */0;\n }\n };\n var apolloMutationFactory = function (jsMutation, variables, refetchQueries, optimisticResponse, param) {\n return Curry._1(jsMutation, {\n variables: variables,\n refetchQueries: refetchQueries,\n optimisticResponse: optimisticResponse\n }).then((function (response) {\n return Promise.resolve(convertExecutionResultToReason(response));\n }));\n };\n var apolloDataToReason = function (apolloData) {\n var match = apolloData.loading;\n var match$1 = ReasonApolloUtils.getNonEmptyObj(apolloData.data);\n var match$2 = apolloData.error;\n if (match) {\n return /* Loading */0;\n } else if (match$1 !== undefined) {\n return /* Data */Block.__(1, [Curry._1(Config.parse, Caml_option.valFromOption(match$1))]);\n } else if (match$2 == null) {\n return /* NotCalled */1;\n } else {\n return /* Error */Block.__(0, [match$2]);\n }\n };\n var convertJsInputToReason = function (apolloData) {\n var data = ReasonApolloUtils.getNonEmptyObj(apolloData.data);\n var tmp;\n if (data !== undefined) {\n var exit = 0;\n var parsedData;\n try {\n parsedData = Curry._1(Config.parse, Caml_option.valFromOption(data));\n exit = 1;\n }\n catch (exn){\n tmp = undefined;\n }\n if (exit === 1) {\n tmp = Caml_option.some(parsedData);\n }\n \n } else {\n tmp = undefined;\n }\n return {\n result: apolloDataToReason(apolloData),\n data: tmp,\n loading: apolloData.loading,\n error: Caml_option.nullable_to_opt(apolloData.error),\n networkStatus: Caml_option.nullable_to_opt(apolloData.networkStatus)\n };\n };\n var JsMutation = { };\n var ReasonApolloMutation$Make = function (Props) {\n var variables = Props.variables;\n var onError = Props.onError;\n var onCompleted = Props.onCompleted;\n var children = Props.children;\n var tmp = {\n mutation: graphqlMutationAST,\n children: (function (mutation, apolloData) {\n return Curry._2(children, (function (param, param$1, param$2, param$3) {\n return apolloMutationFactory(mutation, param, param$1, param$2, param$3);\n }), convertJsInputToReason(apolloData));\n })\n };\n if (variables !== undefined) {\n tmp.variables = Caml_option.valFromOption(variables);\n }\n if (onCompleted !== undefined) {\n tmp.onCompleted = Caml_option.valFromOption(onCompleted);\n }\n if (onError !== undefined) {\n tmp.onError = Caml_option.valFromOption(onError);\n }\n return React.createElement(ReactApollo.Mutation, tmp);\n };\n return {\n graphqlMutationAST: graphqlMutationAST,\n convertExecutionResultToReason: convertExecutionResultToReason,\n apolloMutationFactory: apolloMutationFactory,\n apolloDataToReason: apolloDataToReason,\n convertJsInputToReason: convertJsInputToReason,\n JsMutation: JsMutation,\n make: ReasonApolloMutation$Make\n };\n}\n\nexports.Make = Make;\n/* react Not a pure module */\n\n\n//# sourceURL=webpack:///./node_modules/reason-apollo/src/graphql-types/ReasonApolloMutation.bs.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Make\", function() { return Make; });\n/* harmony import */ var bs_platform_lib_es6_block_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! bs-platform/lib/es6/block.js */ \"./node_modules/bs-platform/lib/es6/block.js\");\n/* harmony import */ var bs_platform_lib_es6_curry_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! bs-platform/lib/es6/curry.js */ \"./node_modules/bs-platform/lib/es6/curry.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! bs-platform/lib/es6/caml_option.js */ \"./node_modules/bs-platform/lib/es6/caml_option.js\");\n/* harmony import */ var graphql_tag__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! graphql-tag */ \"./node_modules/graphql-tag/src/index.js\");\n/* harmony import */ var graphql_tag__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(graphql_tag__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var react_apollo__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-apollo */ \"./node_modules/react-apollo/react-apollo.esm.js\");\n/* harmony import */ var _ReasonApolloUtils_bs_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../ReasonApolloUtils.bs.js */ \"./node_modules/reason-apollo/src/ReasonApolloUtils.bs.js\");\n// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\n\n\n\n\n\n\n\nfunction Make(Config) {\n var graphqlMutationAST = graphql_tag__WEBPACK_IMPORTED_MODULE_4___default.a(Config.query);\n var convertExecutionResultToReason = function (executionResult) {\n var match = _ReasonApolloUtils_bs_js__WEBPACK_IMPORTED_MODULE_6__[\"getNonEmptyObj\"](executionResult.data);\n var match$1 = executionResult.errors;\n if (match !== undefined) {\n return /* Data */bs_platform_lib_es6_block_js__WEBPACK_IMPORTED_MODULE_0__[\"__\"](1, [bs_platform_lib_es6_curry_js__WEBPACK_IMPORTED_MODULE_1__[\"_1\"](Config.parse, bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_3__[\"valFromOption\"](match))]);\n } else if (match$1 == null) {\n return /* EmptyResponse */0;\n } else {\n return /* Errors */bs_platform_lib_es6_block_js__WEBPACK_IMPORTED_MODULE_0__[\"__\"](0, [match$1]);\n }\n };\n var apolloMutationFactory = function (jsMutation, variables, refetchQueries, optimisticResponse, param) {\n return bs_platform_lib_es6_curry_js__WEBPACK_IMPORTED_MODULE_1__[\"_1\"](jsMutation, {\n variables: variables,\n refetchQueries: refetchQueries,\n optimisticResponse: optimisticResponse\n }).then((function (response) {\n return Promise.resolve(convertExecutionResultToReason(response));\n }));\n };\n var apolloDataToReason = function (apolloData) {\n var match = apolloData.loading;\n var match$1 = _ReasonApolloUtils_bs_js__WEBPACK_IMPORTED_MODULE_6__[\"getNonEmptyObj\"](apolloData.data);\n var match$2 = apolloData.error;\n if (match) {\n return /* Loading */0;\n } else if (match$1 !== undefined) {\n return /* Data */bs_platform_lib_es6_block_js__WEBPACK_IMPORTED_MODULE_0__[\"__\"](1, [bs_platform_lib_es6_curry_js__WEBPACK_IMPORTED_MODULE_1__[\"_1\"](Config.parse, bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_3__[\"valFromOption\"](match$1))]);\n } else if (match$2 == null) {\n return /* NotCalled */1;\n } else {\n return /* Error */bs_platform_lib_es6_block_js__WEBPACK_IMPORTED_MODULE_0__[\"__\"](0, [match$2]);\n }\n };\n var convertJsInputToReason = function (apolloData) {\n var match = _ReasonApolloUtils_bs_js__WEBPACK_IMPORTED_MODULE_6__[\"getNonEmptyObj\"](apolloData.data);\n var tmp;\n if (match !== undefined) {\n var exit = 0;\n var parsedData;\n try {\n parsedData = bs_platform_lib_es6_curry_js__WEBPACK_IMPORTED_MODULE_1__[\"_1\"](Config.parse, bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_3__[\"valFromOption\"](match));\n exit = 1;\n }\n catch (exn){\n tmp = undefined;\n }\n if (exit === 1) {\n tmp = bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_3__[\"some\"](parsedData);\n }\n \n } else {\n tmp = undefined;\n }\n return {\n result: apolloDataToReason(apolloData),\n data: tmp,\n loading: apolloData.loading,\n error: bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_3__[\"nullable_to_opt\"](apolloData.error),\n networkStatus: bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_3__[\"nullable_to_opt\"](apolloData.networkStatus)\n };\n };\n var JsMutation = { };\n var ReasonApolloMutation$Make = function (Props) {\n var variables = Props.variables;\n var onError = Props.onError;\n var onCompleted = Props.onCompleted;\n var children = Props.children;\n return react__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"](react_apollo__WEBPACK_IMPORTED_MODULE_5__[\"Mutation\"], {\n mutation: graphqlMutationAST,\n variables: variables,\n onCompleted: onCompleted,\n onError: onError,\n children: (function (mutation, apolloData) {\n return bs_platform_lib_es6_curry_js__WEBPACK_IMPORTED_MODULE_1__[\"_2\"](children, (function (param, param$1, param$2, param$3) {\n return apolloMutationFactory(mutation, param, param$1, param$2, param$3);\n }), convertJsInputToReason(apolloData));\n })\n });\n };\n return {\n graphqlMutationAST: graphqlMutationAST,\n convertExecutionResultToReason: convertExecutionResultToReason,\n apolloMutationFactory: apolloMutationFactory,\n apolloDataToReason: apolloDataToReason,\n convertJsInputToReason: convertJsInputToReason,\n JsMutation: JsMutation,\n make: ReasonApolloMutation$Make\n };\n}\n\n\n/* react Not a pure module */\n\n\n//# sourceURL=webpack:///./node_modules/reason-apollo/src/graphql-types/ReasonApolloMutation.bs.js?"); /***/ }), @@ -1212,11 +1308,11 @@ eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar Block = __web /*!******************************************************************************!*\ !*** ./node_modules/reason-apollo/src/graphql-types/ReasonApolloQuery.bs.js ***! \******************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/*! exports provided: Make */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar Block = __webpack_require__(/*! bs-platform/lib/js/block.js */ \"./node_modules/bs-platform/lib/js/block.js\");\nvar Curry = __webpack_require__(/*! bs-platform/lib/js/curry.js */ \"./node_modules/bs-platform/lib/js/curry.js\");\nvar React = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\nvar Caml_option = __webpack_require__(/*! bs-platform/lib/js/caml_option.js */ \"./node_modules/bs-platform/lib/js/caml_option.js\");\nvar GraphqlTag = __webpack_require__(/*! graphql-tag */ \"./node_modules/graphql-tag/src/index.js\");\nvar ReactApollo = __webpack_require__(/*! react-apollo */ \"./node_modules/react-apollo/react-apollo.esm.js\");\nvar Js_null_undefined = __webpack_require__(/*! bs-platform/lib/js/js_null_undefined.js */ \"./node_modules/bs-platform/lib/js/js_null_undefined.js\");\nvar ReasonApolloUtils = __webpack_require__(/*! ../ReasonApolloUtils.bs.js */ \"./node_modules/reason-apollo/src/ReasonApolloUtils.bs.js\");\n\nfunction Make(Config) {\n var graphqlQueryAST = GraphqlTag.default(Config.query);\n var apolloDataToVariant = function (apolloData) {\n var match = apolloData.loading;\n var match$1 = ReasonApolloUtils.getNonEmptyObj(apolloData.data);\n var match$2 = apolloData.error;\n if (match) {\n return /* Loading */0;\n } else if (match$1 !== undefined) {\n return /* Data */Block.__(1, [Curry._1(Config.parse, Caml_option.valFromOption(match$1))]);\n } else if (match$2 == null) {\n return /* Error */Block.__(0, [{\n message: \"No data\",\n graphQLErrors: null,\n networkError: null\n }]);\n } else {\n return /* Error */Block.__(0, [match$2]);\n }\n };\n var convertJsInputToReason = function (apolloData) {\n var data = ReasonApolloUtils.getNonEmptyObj(apolloData.data);\n var tmp;\n if (data !== undefined) {\n var exit = 0;\n var parsedData;\n try {\n parsedData = Curry._1(Config.parse, Caml_option.valFromOption(data));\n exit = 1;\n }\n catch (exn){\n tmp = undefined;\n }\n if (exit === 1) {\n tmp = Caml_option.some(parsedData);\n }\n \n } else {\n tmp = undefined;\n }\n var error = apolloData.error;\n return {\n result: apolloDataToVariant(apolloData),\n data: tmp,\n error: !(error == null) ? error : undefined,\n loading: apolloData.loading,\n refetch: (function (variables) {\n return Curry._1(apolloData.refetch, Js_null_undefined.fromOption(variables)).then((function (data) {\n return Promise.resolve(apolloDataToVariant(data));\n }));\n }),\n fetchMore: (function (variables, updateQuery, param) {\n return Curry._1(apolloData.fetchMore, {\n variables: variables,\n updateQuery: updateQuery\n });\n }),\n networkStatus: Caml_option.nullable_to_opt(apolloData.networkStatus),\n subscribeToMore: (function ($$document, variables, updateQuery, onError, param) {\n return Curry._1(apolloData.subscribeToMore, {\n document: $$document,\n variables: variables,\n updateQuery: updateQuery,\n onError: onError\n });\n })\n };\n };\n var JsQuery = { };\n var ReasonApolloQuery$Make = function (Props) {\n var variables = Props.variables;\n var pollInterval = Props.pollInterval;\n var notifyOnNetworkStatusChange = Props.notifyOnNetworkStatusChange;\n var fetchPolicy = Props.fetchPolicy;\n var errorPolicy = Props.errorPolicy;\n var ssr = Props.ssr;\n var displayName = Props.displayName;\n var skip = Props.skip;\n var onCompleted = Props.onCompleted;\n var onError = Props.onError;\n var partialRefetch = Props.partialRefetch;\n var delay = Props.delay;\n var context = Props.context;\n var children = Props.children;\n var tmp = {\n query: graphqlQueryAST,\n children: (function (apolloData) {\n return Curry._1(children, convertJsInputToReason(apolloData));\n })\n };\n if (variables !== undefined) {\n tmp.variables = Caml_option.valFromOption(variables);\n }\n if (pollInterval !== undefined) {\n tmp.pollInterval = Caml_option.valFromOption(pollInterval);\n }\n if (notifyOnNetworkStatusChange !== undefined) {\n tmp.notifyOnNetworkStatusChange = Caml_option.valFromOption(notifyOnNetworkStatusChange);\n }\n if (fetchPolicy !== undefined) {\n tmp.fetchPolicy = Caml_option.valFromOption(fetchPolicy);\n }\n if (errorPolicy !== undefined) {\n tmp.errorPolicy = Caml_option.valFromOption(errorPolicy);\n }\n if (ssr !== undefined) {\n tmp.ssr = Caml_option.valFromOption(ssr);\n }\n if (displayName !== undefined) {\n tmp.displayName = Caml_option.valFromOption(displayName);\n }\n if (skip !== undefined) {\n tmp.skip = Caml_option.valFromOption(skip);\n }\n if (onCompleted !== undefined) {\n tmp.onCompleted = Caml_option.valFromOption(onCompleted);\n }\n if (onError !== undefined) {\n tmp.onError = Caml_option.valFromOption(onError);\n }\n if (partialRefetch !== undefined) {\n tmp.partialRefetch = Caml_option.valFromOption(partialRefetch);\n }\n if (delay !== undefined) {\n tmp.delay = Caml_option.valFromOption(delay);\n }\n if (context !== undefined) {\n tmp.context = Caml_option.valFromOption(context);\n }\n return React.createElement(ReactApollo.Query, tmp);\n };\n return {\n graphqlQueryAST: graphqlQueryAST,\n apolloDataToVariant: apolloDataToVariant,\n convertJsInputToReason: convertJsInputToReason,\n JsQuery: JsQuery,\n make: ReasonApolloQuery$Make\n };\n}\n\nexports.Make = Make;\n/* react Not a pure module */\n\n\n//# sourceURL=webpack:///./node_modules/reason-apollo/src/graphql-types/ReasonApolloQuery.bs.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Make\", function() { return Make; });\n/* harmony import */ var bs_platform_lib_es6_block_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! bs-platform/lib/es6/block.js */ \"./node_modules/bs-platform/lib/es6/block.js\");\n/* harmony import */ var bs_platform_lib_es6_curry_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! bs-platform/lib/es6/curry.js */ \"./node_modules/bs-platform/lib/es6/curry.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! bs-platform/lib/es6/caml_option.js */ \"./node_modules/bs-platform/lib/es6/caml_option.js\");\n/* harmony import */ var graphql_tag__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! graphql-tag */ \"./node_modules/graphql-tag/src/index.js\");\n/* harmony import */ var graphql_tag__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(graphql_tag__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var react_apollo__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-apollo */ \"./node_modules/react-apollo/react-apollo.esm.js\");\n/* harmony import */ var bs_platform_lib_es6_js_null_undefined_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! bs-platform/lib/es6/js_null_undefined.js */ \"./node_modules/bs-platform/lib/es6/js_null_undefined.js\");\n/* harmony import */ var _ReasonApolloUtils_bs_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../ReasonApolloUtils.bs.js */ \"./node_modules/reason-apollo/src/ReasonApolloUtils.bs.js\");\n// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\n\n\n\n\n\n\n\n\nfunction Make(Config) {\n var graphqlQueryAST = graphql_tag__WEBPACK_IMPORTED_MODULE_4___default.a(Config.query);\n var apolloDataToVariant = function (apolloData) {\n var match = apolloData.loading;\n var match$1 = _ReasonApolloUtils_bs_js__WEBPACK_IMPORTED_MODULE_7__[\"getNonEmptyObj\"](apolloData.data);\n var match$2 = apolloData.error;\n if (match) {\n return /* Loading */0;\n } else if (match$1 !== undefined) {\n return /* Data */bs_platform_lib_es6_block_js__WEBPACK_IMPORTED_MODULE_0__[\"__\"](1, [bs_platform_lib_es6_curry_js__WEBPACK_IMPORTED_MODULE_1__[\"_1\"](Config.parse, bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_3__[\"valFromOption\"](match$1))]);\n } else if (match$2 == null) {\n return /* Error */bs_platform_lib_es6_block_js__WEBPACK_IMPORTED_MODULE_0__[\"__\"](0, [{\n message: \"No data\",\n graphQLErrors: null,\n networkError: null\n }]);\n } else {\n return /* Error */bs_platform_lib_es6_block_js__WEBPACK_IMPORTED_MODULE_0__[\"__\"](0, [match$2]);\n }\n };\n var convertJsInputToReason = function (apolloData) {\n var match = _ReasonApolloUtils_bs_js__WEBPACK_IMPORTED_MODULE_7__[\"getNonEmptyObj\"](apolloData.data);\n var tmp;\n if (match !== undefined) {\n var exit = 0;\n var parsedData;\n try {\n parsedData = bs_platform_lib_es6_curry_js__WEBPACK_IMPORTED_MODULE_1__[\"_1\"](Config.parse, bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_3__[\"valFromOption\"](match));\n exit = 1;\n }\n catch (exn){\n tmp = undefined;\n }\n if (exit === 1) {\n tmp = bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_3__[\"some\"](parsedData);\n }\n \n } else {\n tmp = undefined;\n }\n var match$1 = apolloData.error;\n return {\n result: apolloDataToVariant(apolloData),\n data: tmp,\n error: (match$1 == null) ? undefined : match$1,\n loading: apolloData.loading,\n refetch: (function (variables) {\n return bs_platform_lib_es6_curry_js__WEBPACK_IMPORTED_MODULE_1__[\"_1\"](apolloData.refetch, bs_platform_lib_es6_js_null_undefined_js__WEBPACK_IMPORTED_MODULE_6__[\"fromOption\"](variables)).then((function (data) {\n return Promise.resolve(apolloDataToVariant(data));\n }));\n }),\n fetchMore: (function (variables, updateQuery, param) {\n return bs_platform_lib_es6_curry_js__WEBPACK_IMPORTED_MODULE_1__[\"_1\"](apolloData.fetchMore, {\n variables: variables,\n updateQuery: updateQuery\n });\n }),\n networkStatus: bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_3__[\"nullable_to_opt\"](apolloData.networkStatus),\n subscribeToMore: (function ($$document, variables, updateQuery, onError, param) {\n return bs_platform_lib_es6_curry_js__WEBPACK_IMPORTED_MODULE_1__[\"_1\"](apolloData.subscribeToMore, {\n document: $$document,\n variables: variables,\n updateQuery: updateQuery,\n onError: onError\n });\n })\n };\n };\n var JsQuery = { };\n var ReasonApolloQuery$Make = function (Props) {\n var variables = Props.variables;\n var pollInterval = Props.pollInterval;\n var notifyOnNetworkStatusChange = Props.notifyOnNetworkStatusChange;\n var fetchPolicy = Props.fetchPolicy;\n var errorPolicy = Props.errorPolicy;\n var ssr = Props.ssr;\n var displayName = Props.displayName;\n var skip = Props.skip;\n var onCompleted = Props.onCompleted;\n var onError = Props.onError;\n var partialRefetch = Props.partialRefetch;\n var delay = Props.delay;\n var context = Props.context;\n var children = Props.children;\n return react__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"](react_apollo__WEBPACK_IMPORTED_MODULE_5__[\"Query\"], {\n query: graphqlQueryAST,\n variables: variables,\n pollInterval: pollInterval,\n notifyOnNetworkStatusChange: notifyOnNetworkStatusChange,\n fetchPolicy: fetchPolicy,\n errorPolicy: errorPolicy,\n ssr: ssr,\n displayName: displayName,\n skip: skip,\n onCompleted: onCompleted,\n onError: onError,\n partialRefetch: partialRefetch,\n delay: delay,\n context: context,\n children: (function (apolloData) {\n return bs_platform_lib_es6_curry_js__WEBPACK_IMPORTED_MODULE_1__[\"_1\"](children, convertJsInputToReason(apolloData));\n })\n });\n };\n return {\n graphqlQueryAST: graphqlQueryAST,\n apolloDataToVariant: apolloDataToVariant,\n convertJsInputToReason: convertJsInputToReason,\n JsQuery: JsQuery,\n make: ReasonApolloQuery$Make\n };\n}\n\n\n/* react Not a pure module */\n\n\n//# sourceURL=webpack:///./node_modules/reason-apollo/src/graphql-types/ReasonApolloQuery.bs.js?"); /***/ }), @@ -1224,11 +1320,11 @@ eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar Block = __web /*!*************************************************************************************!*\ !*** ./node_modules/reason-apollo/src/graphql-types/ReasonApolloSubscription.bs.js ***! \*************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/*! exports provided: Make */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar Block = __webpack_require__(/*! bs-platform/lib/js/block.js */ \"./node_modules/bs-platform/lib/js/block.js\");\nvar Curry = __webpack_require__(/*! bs-platform/lib/js/curry.js */ \"./node_modules/bs-platform/lib/js/curry.js\");\nvar React = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\nvar Caml_option = __webpack_require__(/*! bs-platform/lib/js/caml_option.js */ \"./node_modules/bs-platform/lib/js/caml_option.js\");\nvar GraphqlTag = __webpack_require__(/*! graphql-tag */ \"./node_modules/graphql-tag/src/index.js\");\nvar ReactApollo = __webpack_require__(/*! react-apollo */ \"./node_modules/react-apollo/react-apollo.esm.js\");\nvar ReasonApolloUtils = __webpack_require__(/*! ../ReasonApolloUtils.bs.js */ \"./node_modules/reason-apollo/src/ReasonApolloUtils.bs.js\");\n\nfunction Make(Config) {\n var graphQLSubscriptionAST = GraphqlTag.default(Config.query);\n var apolloDataToVariant = function (apolloData) {\n var match = apolloData.loading;\n var match$1 = ReasonApolloUtils.getNonEmptyObj(apolloData.data);\n var match$2 = apolloData.error;\n if (match) {\n return /* Loading */0;\n } else if (match$1 !== undefined) {\n return /* Data */Block.__(1, [Curry._1(Config.parse, Caml_option.valFromOption(match$1))]);\n } else if (match$2 == null) {\n return /* Error */Block.__(0, [{\n message: \"No data\",\n graphQLErrors: null,\n networkError: null\n }]);\n } else {\n return /* Error */Block.__(0, [match$2]);\n }\n };\n var convertJsInputToReason = function (apolloData) {\n var data = ReasonApolloUtils.getNonEmptyObj(apolloData.data);\n var tmp;\n if (data !== undefined) {\n var exit = 0;\n var parsedData;\n try {\n parsedData = Curry._1(Config.parse, Caml_option.valFromOption(data));\n exit = 1;\n }\n catch (exn){\n tmp = undefined;\n }\n if (exit === 1) {\n tmp = Caml_option.some(parsedData);\n }\n \n } else {\n tmp = undefined;\n }\n var error = apolloData.error;\n return {\n result: apolloDataToVariant(apolloData),\n data: tmp,\n error: !(error == null) ? error : undefined,\n loading: apolloData.loading\n };\n };\n var JsSubscription = { };\n var ReasonApolloSubscription$Make = function (Props) {\n var variables = Props.variables;\n var children = Props.children;\n return React.createElement(ReactApollo.Subscription, {\n subscription: graphQLSubscriptionAST,\n variables: variables,\n children: (function (apolloData) {\n return Curry._1(children, convertJsInputToReason(apolloData));\n })\n });\n };\n return {\n graphQLSubscriptionAST: graphQLSubscriptionAST,\n apolloDataToVariant: apolloDataToVariant,\n convertJsInputToReason: convertJsInputToReason,\n JsSubscription: JsSubscription,\n make: ReasonApolloSubscription$Make\n };\n}\n\nexports.Make = Make;\n/* react Not a pure module */\n\n\n//# sourceURL=webpack:///./node_modules/reason-apollo/src/graphql-types/ReasonApolloSubscription.bs.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Make\", function() { return Make; });\n/* harmony import */ var bs_platform_lib_es6_block_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! bs-platform/lib/es6/block.js */ \"./node_modules/bs-platform/lib/es6/block.js\");\n/* harmony import */ var bs_platform_lib_es6_curry_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! bs-platform/lib/es6/curry.js */ \"./node_modules/bs-platform/lib/es6/curry.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! bs-platform/lib/es6/caml_option.js */ \"./node_modules/bs-platform/lib/es6/caml_option.js\");\n/* harmony import */ var graphql_tag__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! graphql-tag */ \"./node_modules/graphql-tag/src/index.js\");\n/* harmony import */ var graphql_tag__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(graphql_tag__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var react_apollo__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-apollo */ \"./node_modules/react-apollo/react-apollo.esm.js\");\n/* harmony import */ var _ReasonApolloUtils_bs_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../ReasonApolloUtils.bs.js */ \"./node_modules/reason-apollo/src/ReasonApolloUtils.bs.js\");\n// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\n\n\n\n\n\n\n\nfunction Make(Config) {\n var graphQLSubscriptionAST = graphql_tag__WEBPACK_IMPORTED_MODULE_4___default.a(Config.query);\n var apolloDataToVariant = function (apolloData) {\n var match = apolloData.loading;\n var match$1 = _ReasonApolloUtils_bs_js__WEBPACK_IMPORTED_MODULE_6__[\"getNonEmptyObj\"](apolloData.data);\n var match$2 = apolloData.error;\n if (match) {\n return /* Loading */0;\n } else if (match$1 !== undefined) {\n return /* Data */bs_platform_lib_es6_block_js__WEBPACK_IMPORTED_MODULE_0__[\"__\"](1, [bs_platform_lib_es6_curry_js__WEBPACK_IMPORTED_MODULE_1__[\"_1\"](Config.parse, bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_3__[\"valFromOption\"](match$1))]);\n } else if (match$2 == null) {\n return /* Error */bs_platform_lib_es6_block_js__WEBPACK_IMPORTED_MODULE_0__[\"__\"](0, [{\n message: \"No data\",\n graphQLErrors: null,\n networkError: null\n }]);\n } else {\n return /* Error */bs_platform_lib_es6_block_js__WEBPACK_IMPORTED_MODULE_0__[\"__\"](0, [match$2]);\n }\n };\n var convertJsInputToReason = function (apolloData) {\n var match = _ReasonApolloUtils_bs_js__WEBPACK_IMPORTED_MODULE_6__[\"getNonEmptyObj\"](apolloData.data);\n var tmp;\n if (match !== undefined) {\n var exit = 0;\n var parsedData;\n try {\n parsedData = bs_platform_lib_es6_curry_js__WEBPACK_IMPORTED_MODULE_1__[\"_1\"](Config.parse, bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_3__[\"valFromOption\"](match));\n exit = 1;\n }\n catch (exn){\n tmp = undefined;\n }\n if (exit === 1) {\n tmp = bs_platform_lib_es6_caml_option_js__WEBPACK_IMPORTED_MODULE_3__[\"some\"](parsedData);\n }\n \n } else {\n tmp = undefined;\n }\n var match$1 = apolloData.error;\n return {\n result: apolloDataToVariant(apolloData),\n data: tmp,\n error: (match$1 == null) ? undefined : match$1,\n loading: apolloData.loading\n };\n };\n var JsSubscription = { };\n var ReasonApolloSubscription$Make = function (Props) {\n var variables = Props.variables;\n var children = Props.children;\n return react__WEBPACK_IMPORTED_MODULE_2__[\"createElement\"](react_apollo__WEBPACK_IMPORTED_MODULE_5__[\"Subscription\"], {\n subscription: graphQLSubscriptionAST,\n variables: variables,\n children: (function (apolloData) {\n return bs_platform_lib_es6_curry_js__WEBPACK_IMPORTED_MODULE_1__[\"_1\"](children, convertJsInputToReason(apolloData));\n })\n });\n };\n return {\n graphQLSubscriptionAST: graphQLSubscriptionAST,\n apolloDataToVariant: apolloDataToVariant,\n convertJsInputToReason: convertJsInputToReason,\n JsSubscription: JsSubscription,\n make: ReasonApolloSubscription$Make\n };\n}\n\n\n/* react Not a pure module */\n\n\n//# sourceURL=webpack:///./node_modules/reason-apollo/src/graphql-types/ReasonApolloSubscription.bs.js?"); /***/ }), @@ -1236,11 +1332,11 @@ eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar Block = __web /*!*****************************************************!*\ !*** ./node_modules/reason-react/src/ReactDOMRe.js ***! \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/*! exports provided: renderToElementWithClassName, renderToElementWithId, hydrateToElementWithClassName, hydrateToElementWithId, Ref, createElementVariadic, Style */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n\nvar Block = __webpack_require__(/*! bs-platform/lib/js/block.js */ \"./node_modules/bs-platform/lib/js/block.js\");\nvar React = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\nvar ReactDom = __webpack_require__(/*! react-dom */ \"./node_modules/react-dom/index.js\");\nvar Caml_builtin_exceptions = __webpack_require__(/*! bs-platform/lib/js/caml_builtin_exceptions.js */ \"./node_modules/bs-platform/lib/js/caml_builtin_exceptions.js\");\n\nfunction renderToElementWithClassName(reactElement, className) {\n var elements = document.getElementsByClassName(className);\n if (elements.length !== 0) {\n ReactDom.render(reactElement, elements[0]);\n return ;\n } else {\n console.error(\"ReactDOMRe.renderToElementWithClassName: no element of class \" + (className + \" found in the HTML.\"));\n return ;\n }\n}\n\nfunction renderToElementWithId(reactElement, id) {\n var element = document.getElementById(id);\n if (element == null) {\n console.error(\"ReactDOMRe.renderToElementWithId : no element of id \" + (id + \" found in the HTML.\"));\n return ;\n } else {\n ReactDom.render(reactElement, element);\n return ;\n }\n}\n\nfunction createRootWithClassName(className) {\n var elements = document.getElementsByClassName(className);\n if (elements.length !== 0) {\n return /* Ok */Block.__(0, [ReactDom.createRoot(elements[0])]);\n } else {\n return /* Error */Block.__(1, [\"ReactDOMRe.Unstable.createRootWithClassName: no element of class \" + (className + \" found in the HTML.\")]);\n }\n}\n\nfunction createRootWithId(id) {\n var element = document.getElementById(id);\n if (element == null) {\n return /* Error */Block.__(1, [\"ReactDOMRe.Unstable.createRootWithId: no element of id \" + (id + \" found in the HTML.\")]);\n } else {\n return /* Ok */Block.__(0, [ReactDom.createRoot(element)]);\n }\n}\n\nvar Experimental = {\n createRootWithClassName: createRootWithClassName,\n createRootWithId: createRootWithId\n};\n\nfunction hydrateToElementWithClassName(reactElement, className) {\n var elements = document.getElementsByClassName(className);\n if (elements.length !== 0) {\n ReactDom.hydrate(reactElement, elements[0]);\n return ;\n } else {\n console.error(\"ReactDOMRe.hydrateToElementWithClassName: no element of class \" + (className + \" found in the HTML.\"));\n return ;\n }\n}\n\nfunction hydrateToElementWithId(reactElement, id) {\n var element = document.getElementById(id);\n if (element == null) {\n throw [\n Caml_builtin_exceptions.invalid_argument,\n \"ReactDOMRe.hydrateToElementWithId : no element of id \" + (id + \" found in the HTML.\")\n ];\n }\n ReactDom.hydrate(reactElement, element);\n \n}\n\nvar Ref = { };\n\nfunction createElementVariadic(domClassName, props, children) {\n var variadicArguments = [\n domClassName,\n props\n ].concat(children);\n return React.createElement.apply(null, variadicArguments);\n}\n\nfunction unsafeAddProp(style, key, value) {\n var dict = { };\n dict[key] = value;\n return Object.assign(({}), style, dict);\n}\n\nvar Style = {\n unsafeAddProp: unsafeAddProp\n};\n\nexports.renderToElementWithClassName = renderToElementWithClassName;\nexports.renderToElementWithId = renderToElementWithId;\nexports.Experimental = Experimental;\nexports.hydrateToElementWithClassName = hydrateToElementWithClassName;\nexports.hydrateToElementWithId = hydrateToElementWithId;\nexports.Ref = Ref;\nexports.createElementVariadic = createElementVariadic;\nexports.Style = Style;\n/* react Not a pure module */\n\n\n//# sourceURL=webpack:///./node_modules/reason-react/src/ReactDOMRe.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"renderToElementWithClassName\", function() { return renderToElementWithClassName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"renderToElementWithId\", function() { return renderToElementWithId; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hydrateToElementWithClassName\", function() { return hydrateToElementWithClassName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hydrateToElementWithId\", function() { return hydrateToElementWithId; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Ref\", function() { return Ref; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createElementVariadic\", function() { return createElementVariadic; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Style\", function() { return Style; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"./node_modules/react-dom/index.js\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var bs_platform_lib_es6_caml_builtin_exceptions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! bs-platform/lib/es6/caml_builtin_exceptions.js */ \"./node_modules/bs-platform/lib/es6/caml_builtin_exceptions.js\");\n\n\n\n\n\n\nfunction renderToElementWithClassName(reactElement, className) {\n var elements = document.getElementsByClassName(className);\n if (elements.length !== 0) {\n react_dom__WEBPACK_IMPORTED_MODULE_1__[\"render\"](reactElement, elements[0]);\n return /* () */0;\n } else {\n throw [\n bs_platform_lib_es6_caml_builtin_exceptions_js__WEBPACK_IMPORTED_MODULE_2__[\"invalid_argument\"],\n \"ReactDOMRe.renderToElementWithClassName: no element of class \" + (className + \" found in the HTML.\")\n ];\n }\n}\n\nfunction renderToElementWithId(reactElement, id) {\n var match = document.getElementById(id);\n if (match == null) {\n throw [\n bs_platform_lib_es6_caml_builtin_exceptions_js__WEBPACK_IMPORTED_MODULE_2__[\"invalid_argument\"],\n \"ReactDOMRe.renderToElementWithId : no element of id \" + (id + \" found in the HTML.\")\n ];\n } else {\n react_dom__WEBPACK_IMPORTED_MODULE_1__[\"render\"](reactElement, match);\n return /* () */0;\n }\n}\n\nfunction hydrateToElementWithClassName(reactElement, className) {\n var elements = document.getElementsByClassName(className);\n if (elements.length !== 0) {\n react_dom__WEBPACK_IMPORTED_MODULE_1__[\"hydrate\"](reactElement, elements[0]);\n return /* () */0;\n } else {\n throw [\n bs_platform_lib_es6_caml_builtin_exceptions_js__WEBPACK_IMPORTED_MODULE_2__[\"invalid_argument\"],\n \"ReactDOMRe.hydrateToElementWithClassName: no element of class \" + (className + \" found in the HTML.\")\n ];\n }\n}\n\nfunction hydrateToElementWithId(reactElement, id) {\n var match = document.getElementById(id);\n if (match == null) {\n throw [\n bs_platform_lib_es6_caml_builtin_exceptions_js__WEBPACK_IMPORTED_MODULE_2__[\"invalid_argument\"],\n \"ReactDOMRe.hydrateToElementWithId : no element of id \" + (id + \" found in the HTML.\")\n ];\n } else {\n react_dom__WEBPACK_IMPORTED_MODULE_1__[\"hydrate\"](reactElement, match);\n return /* () */0;\n }\n}\n\nvar Ref = /* module */[];\n\nfunction createElementVariadic(domClassName, props, children) {\n var variadicArguments = /* array */[\n domClassName,\n props\n ].concat(children);\n return react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"].apply(null, variadicArguments);\n}\n\nfunction combine(a, b) {\n return Object.assign(Object.assign({ }, a), b);\n}\n\nfunction unsafeAddProp(style, property, value) {\n var dict = { };\n dict[property] = value;\n return combine(style, dict);\n}\n\nvar Style = /* module */[\n /* combine */combine,\n /* unsafeAddProp */unsafeAddProp\n];\n\n\n/* react Not a pure module */\n\n\n//# sourceURL=webpack:///./node_modules/reason-react/src/ReactDOMRe.js?"); /***/ }), @@ -1608,7 +1704,7 @@ eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar React = __web /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar Curry = __webpack_require__(/*! bs-platform/lib/js/curry.js */ \"./node_modules/bs-platform/lib/js/curry.js\");\nvar React = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\nvar ApolloHooks = __webpack_require__(/*! reason-apollo-hooks/src/ApolloHooks.bs.js */ \"./node_modules/reason-apollo-hooks/src/ApolloHooks.bs.js\");\nvar Belt_Option = __webpack_require__(/*! bs-platform/lib/js/belt_Option.js */ \"./node_modules/bs-platform/lib/js/belt_Option.js\");\nvar Caml_option = __webpack_require__(/*! bs-platform/lib/js/caml_option.js */ \"./node_modules/bs-platform/lib/js/caml_option.js\");\nvar LoadMore$ReactHooksTemplate = __webpack_require__(/*! ./LoadMore.bs.js */ \"./src/LoadMore.bs.js\");\nvar AddPerson$ReactHooksTemplate = __webpack_require__(/*! ./AddPerson.bs.js */ \"./src/AddPerson.bs.js\");\nvar EditPerson$ReactHooksTemplate = __webpack_require__(/*! ./EditPerson.bs.js */ \"./src/EditPerson.bs.js\");\nvar FilterByAge$ReactHooksTemplate = __webpack_require__(/*! ./FilterByAge.bs.js */ \"./src/FilterByAge.bs.js\");\nvar SubscribeToMore$ReactHooksTemplate = __webpack_require__(/*! ./SubscribeToMore.bs.js */ \"./src/SubscribeToMore.bs.js\");\nvar FilterByNameCache$ReactHooksTemplate = __webpack_require__(/*! ./FilterByNameCache.bs.js */ \"./src/FilterByNameCache.bs.js\");\nvar FilterByAgeErrorHandling$ReactHooksTemplate = __webpack_require__(/*! ./FilterByAgeErrorHandling.bs.js */ \"./src/FilterByAgeErrorHandling.bs.js\");\n\nvar filterName = \"Bob\";\n\nfunction Root(Props) {\n var match = React.useState((function () {\n return /* LoadMore */0;\n }));\n var setActiveExample = match[1];\n var activeExample = match[0];\n var editPersonRefetchQueries = function (param) {\n var query = FilterByAge$ReactHooksTemplate.PersonsOlderThanQuery.make(42, undefined);\n return [ApolloHooks.toQueryObj(query)];\n };\n var editPersonUpdate = function (client, mutationResult) {\n var data = Belt_Option.flatMap(mutationResult.data, (function (result) {\n return result.updatePerson;\n }));\n if (data !== undefined) {\n return FilterByNameCache$ReactHooksTemplate.updateCache(client, Caml_option.valFromOption(data), filterName);\n }\n \n };\n return React.createElement(React.Fragment, undefined, React.createElement(\"div\", {\n className: \"tabs\"\n }, React.createElement(\"button\", {\n className: \"tab\" + (\n /* LoadMore */0 === activeExample ? \" selected-tab\" : \"\"\n ),\n onClick: (function (param) {\n return Curry._1(setActiveExample, (function (param) {\n return /* LoadMore */0;\n }));\n })\n }, \"Load More\"), React.createElement(\"button\", {\n className: \"tab\" + (\n /* SubscribeToMore */1 === activeExample ? \" selected-tab\" : \"\"\n ),\n onClick: (function (param) {\n return Curry._1(setActiveExample, (function (param) {\n return /* SubscribeToMore */1;\n }));\n })\n }, \"Subscribe to More\")), React.createElement(\"div\", {\n className: \"tab-content\"\n }, activeExample ? React.createElement(React.Fragment, undefined, React.createElement(\"div\", {\n className: \"add-person-container\"\n }, React.createElement(\"div\", {\n className: \"add-person\"\n }, React.createElement(AddPerson$ReactHooksTemplate.make, { }))), React.createElement(SubscribeToMore$ReactHooksTemplate.make, { })) : React.createElement(React.Fragment, undefined, React.createElement(\"div\", {\n className: \"edit-person-container\"\n }, React.createElement(\"div\", {\n className: \"edit-person\"\n }, React.createElement(EditPerson$ReactHooksTemplate.make, {\n refetchQueries: editPersonRefetchQueries,\n update: editPersonUpdate\n }), React.createElement(FilterByAge$ReactHooksTemplate.make, {\n age: 42\n }), React.createElement(FilterByAgeErrorHandling$ReactHooksTemplate.make, {\n age: 42\n }), React.createElement(FilterByNameCache$ReactHooksTemplate.make, {\n name: filterName\n }))), React.createElement(LoadMore$ReactHooksTemplate.make, { }))));\n}\n\nvar filterAgeLimit = 42;\n\nvar make = Root;\n\nexports.filterAgeLimit = filterAgeLimit;\nexports.filterName = filterName;\nexports.make = make;\n/* react Not a pure module */\n\n\n//# sourceURL=webpack:///./src/Root.bs.js?"); +eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar Curry = __webpack_require__(/*! bs-platform/lib/js/curry.js */ \"./node_modules/bs-platform/lib/js/curry.js\");\nvar React = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\nvar ApolloHooks = __webpack_require__(/*! reason-apollo-hooks/src/ApolloHooks.bs.js */ \"./node_modules/reason-apollo-hooks/src/ApolloHooks.bs.js\");\nvar Belt_Option = __webpack_require__(/*! bs-platform/lib/js/belt_Option.js */ \"./node_modules/bs-platform/lib/js/belt_Option.js\");\nvar Caml_option = __webpack_require__(/*! bs-platform/lib/js/caml_option.js */ \"./node_modules/bs-platform/lib/js/caml_option.js\");\nvar LoadMore$ReactHooksTemplate = __webpack_require__(/*! ./LoadMore.bs.js */ \"./src/LoadMore.bs.js\");\nvar AddPerson$ReactHooksTemplate = __webpack_require__(/*! ./AddPerson.bs.js */ \"./src/AddPerson.bs.js\");\nvar EditPerson$ReactHooksTemplate = __webpack_require__(/*! ./EditPerson.bs.js */ \"./src/EditPerson.bs.js\");\nvar FilterByAge$ReactHooksTemplate = __webpack_require__(/*! ./FilterByAge.bs.js */ \"./src/FilterByAge.bs.js\");\nvar SubscribeToMore$ReactHooksTemplate = __webpack_require__(/*! ./SubscribeToMore.bs.js */ \"./src/SubscribeToMore.bs.js\");\nvar FilterByNameCache$ReactHooksTemplate = __webpack_require__(/*! ./FilterByNameCache.bs.js */ \"./src/FilterByNameCache.bs.js\");\nvar LoadMoreFragments$ReactHooksTemplate = __webpack_require__(/*! ./fragments/LoadMoreFragments.bs.js */ \"./src/fragments/LoadMoreFragments.bs.js\");\nvar FilterByAgeFragment$ReactHooksTemplate = __webpack_require__(/*! ./fragments/FilterByAgeFragment.bs.js */ \"./src/fragments/FilterByAgeFragment.bs.js\");\nvar FilterByAgeErrorHandling$ReactHooksTemplate = __webpack_require__(/*! ./FilterByAgeErrorHandling.bs.js */ \"./src/FilterByAgeErrorHandling.bs.js\");\n\nvar filterName = \"Bob\";\n\nfunction Root(Props) {\n var match = React.useState((function () {\n return /* LoadMore */0;\n }));\n var setActiveExample = match[1];\n var activeExample = match[0];\n var editPersonRefetchQueries = function (param) {\n var query = FilterByAge$ReactHooksTemplate.PersonsOlderThanQuery.make(42, undefined);\n return [ApolloHooks.toQueryObj(query)];\n };\n var editPersonUpdate = function (client, mutationResult) {\n var data = Belt_Option.flatMap(mutationResult.data, (function (result) {\n return result.updatePerson;\n }));\n if (data !== undefined) {\n return FilterByNameCache$ReactHooksTemplate.updateCache(client, Caml_option.valFromOption(data), filterName);\n }\n \n };\n var tmp;\n switch (activeExample) {\n case /* LoadMore */0 :\n tmp = React.createElement(React.Fragment, undefined, React.createElement(\"div\", {\n className: \"edit-person-container\"\n }, React.createElement(\"div\", {\n className: \"edit-person\"\n }, React.createElement(EditPerson$ReactHooksTemplate.make, {\n refetchQueries: editPersonRefetchQueries,\n update: editPersonUpdate\n }), React.createElement(\"h3\", undefined, \"FilterByAge.re\"), React.createElement(FilterByAge$ReactHooksTemplate.make, {\n age: 42\n }), React.createElement(\"section\", undefined, React.createElement(\"title\", undefined, \"FilterByAgeErrorHandling.re\"), React.createElement(FilterByAgeErrorHandling$ReactHooksTemplate.make, {\n age: 42\n })), React.createElement(\"h3\", undefined, \"FilterByAgeFragment.re\"), React.createElement(FilterByAgeFragment$ReactHooksTemplate.make, {\n age: 42\n }), React.createElement(\"h3\", undefined, \"FilterByNameCache.re\"), React.createElement(FilterByNameCache$ReactHooksTemplate.make, {\n name: filterName\n }))), React.createElement(LoadMore$ReactHooksTemplate.make, { }));\n break;\n case /* LoadMoreFragments */1 :\n tmp = React.createElement(React.Fragment, undefined, React.createElement(\"div\", {\n className: \"edit-person-container\"\n }, React.createElement(\"div\", {\n className: \"edit-person\"\n }, React.createElement(EditPerson$ReactHooksTemplate.make, {\n refetchQueries: editPersonRefetchQueries,\n update: editPersonUpdate\n }), React.createElement(\"h3\", undefined, \"FilterByAge.re\"), React.createElement(FilterByAge$ReactHooksTemplate.make, {\n age: 42\n }), React.createElement(\"section\", undefined, React.createElement(\"title\", undefined, \"FilterByAgeErrorHandling.re\"), React.createElement(FilterByAgeErrorHandling$ReactHooksTemplate.make, {\n age: 42\n })), React.createElement(\"h3\", undefined, \"FilterByAgeFragment.re\"), React.createElement(FilterByAgeFragment$ReactHooksTemplate.make, {\n age: 42\n }), React.createElement(\"h3\", undefined, \"FilterByNameCache.re\"), React.createElement(FilterByNameCache$ReactHooksTemplate.make, {\n name: filterName\n }))), React.createElement(LoadMoreFragments$ReactHooksTemplate.make, { }));\n break;\n case /* SubscribeToMore */2 :\n tmp = React.createElement(React.Fragment, undefined, React.createElement(\"div\", {\n className: \"add-person-container\"\n }, React.createElement(\"div\", {\n className: \"add-person\"\n }, React.createElement(AddPerson$ReactHooksTemplate.make, { }))), React.createElement(SubscribeToMore$ReactHooksTemplate.make, { }));\n break;\n \n }\n return React.createElement(React.Fragment, undefined, React.createElement(\"div\", {\n className: \"tabs\"\n }, React.createElement(\"button\", {\n className: \"tab\" + (\n /* LoadMore */0 === activeExample ? \" selected-tab\" : \"\"\n ),\n onClick: (function (param) {\n return Curry._1(setActiveExample, (function (param) {\n return /* LoadMore */0;\n }));\n })\n }, \"Load More\"), React.createElement(\"button\", {\n className: \"tab\" + (\n /* SubscribeToMore */2 === activeExample ? \" selected-tab\" : \"\"\n ),\n onClick: (function (param) {\n return Curry._1(setActiveExample, (function (param) {\n return /* SubscribeToMore */2;\n }));\n })\n }, \"Subscribe to More\"), React.createElement(\"button\", {\n className: \"tab\" + (\n /* LoadMoreFragments */1 === activeExample ? \" selected-tab\" : \"\"\n ),\n onClick: (function (param) {\n return Curry._1(setActiveExample, (function (param) {\n return /* LoadMoreFragments */1;\n }));\n })\n }, \"Load More Fragments\")), React.createElement(\"div\", {\n className: \"tab-content\"\n }, tmp));\n}\n\nvar filterAgeLimit = 42;\n\nvar make = Root;\n\nexports.filterAgeLimit = filterAgeLimit;\nexports.filterName = filterName;\nexports.make = make;\n/* react Not a pure module */\n\n\n//# sourceURL=webpack:///./src/Root.bs.js?"); /***/ }), @@ -1624,6 +1720,42 @@ eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar Curry = __web /***/ }), +/***/ "./src/fragments/FilterByAgeFragment.bs.js": +/*!*************************************************!*\ + !*** ./src/fragments/FilterByAgeFragment.bs.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar Curry = __webpack_require__(/*! bs-platform/lib/js/curry.js */ \"./node_modules/bs-platform/lib/js/curry.js\");\nvar React = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\nvar Js_exn = __webpack_require__(/*! bs-platform/lib/js/js_exn.js */ \"./node_modules/bs-platform/lib/js/js_exn.js\");\nvar Js_dict = __webpack_require__(/*! bs-platform/lib/js/js_dict.js */ \"./node_modules/bs-platform/lib/js/js_dict.js\");\nvar Js_json = __webpack_require__(/*! bs-platform/lib/js/js_json.js */ \"./node_modules/bs-platform/lib/js/js_json.js\");\nvar Js_option = __webpack_require__(/*! bs-platform/lib/js/js_option.js */ \"./node_modules/bs-platform/lib/js/js_option.js\");\nvar ApolloHooks = __webpack_require__(/*! reason-apollo-hooks/src/ApolloHooks.bs.js */ \"./node_modules/reason-apollo-hooks/src/ApolloHooks.bs.js\");\nvar Caml_option = __webpack_require__(/*! bs-platform/lib/js/caml_option.js */ \"./node_modules/bs-platform/lib/js/caml_option.js\");\nvar Fragments$ReactHooksTemplate = __webpack_require__(/*! ./Fragments.bs.js */ \"./src/fragments/Fragments.bs.js\");\n\nvar ppx_printed_query = \"query getPersonsOlderThan($age: Int!) {\\nallPersons(filter: {age_gte: $age}) {\\n...\" + Fragments$ReactHooksTemplate.PersonFragment.Person.name + \" \\n}\\n\\n}\\n\" + Fragments$ReactHooksTemplate.PersonFragment.Person.query;\n\nfunction parse(value) {\n var value$1 = Js_option.getExn(Js_json.decodeObject(value));\n var value$2 = Js_dict.get(value$1, \"allPersons\");\n return {\n allPersons: value$2 !== undefined ? Js_option.getExn(Js_json.decodeArray(Caml_option.valFromOption(value$2))).map((function (value) {\n return Curry._1(Fragments$ReactHooksTemplate.PersonFragment.Person.parse, value);\n })) : Js_exn.raiseError(\"graphql_ppx: Field allPersons on type Query is missing\")\n };\n}\n\nfunction make(age, param) {\n return {\n query: ppx_printed_query,\n variables: Js_dict.fromArray([/* tuple */[\n \"age\",\n age\n ]].filter((function (param) {\n return !Js_json.test(param[1], /* Null */5);\n }))),\n parse: parse\n };\n}\n\nfunction makeWithVariables(variables) {\n var age = variables.age;\n return {\n query: ppx_printed_query,\n variables: Js_dict.fromArray([/* tuple */[\n \"age\",\n age\n ]].filter((function (param) {\n return !Js_json.test(param[1], /* Null */5);\n }))),\n parse: parse\n };\n}\n\nfunction makeVariables(age, param) {\n return Js_dict.fromArray([/* tuple */[\n \"age\",\n age\n ]].filter((function (param) {\n return !Js_json.test(param[1], /* Null */5);\n })));\n}\n\nfunction definition_002(graphql_ppx_use_json_variables_fn, age, param) {\n return Curry._1(graphql_ppx_use_json_variables_fn, Js_dict.fromArray([/* tuple */[\n \"age\",\n age\n ]].filter((function (param) {\n return !Js_json.test(param[1], /* Null */5);\n }))));\n}\n\nvar definition = /* tuple */[\n parse,\n ppx_printed_query,\n definition_002\n];\n\nfunction ret_type(f) {\n return { };\n}\n\nvar MT_Ret = { };\n\nvar PersonsOlderThanQuery = {\n ppx_printed_query: ppx_printed_query,\n query: ppx_printed_query,\n parse: parse,\n make: make,\n makeWithVariables: makeWithVariables,\n makeVariables: makeVariables,\n definition: definition,\n ret_type: ret_type,\n MT_Ret: MT_Ret\n};\n\nfunction FilterByAgeFragment(Props) {\n var age = Props.age;\n var match = ApolloHooks.useQuery(undefined, Caml_option.some(makeVariables(age, undefined)), undefined, undefined, undefined, undefined, undefined, undefined, definition);\n var simple = match[0];\n var tmp;\n tmp = typeof simple === \"number\" ? (\n simple === /* Loading */0 ? React.createElement(\"p\", undefined, \"Loading...\") : React.createElement(\"p\", undefined, \"Error\")\n ) : (\n simple.tag ? React.createElement(\"p\", undefined, \"Error\") : React.createElement(\"h3\", undefined, \"There are \" + (String(simple[0].allPersons.length) + (\" people older than \" + String(age))))\n );\n return React.createElement(\"div\", undefined, tmp);\n}\n\nvar make$1 = FilterByAgeFragment;\n\nexports.PersonsOlderThanQuery = PersonsOlderThanQuery;\nexports.make = make$1;\n/* react Not a pure module */\n\n\n//# sourceURL=webpack:///./src/fragments/FilterByAgeFragment.bs.js?"); + +/***/ }), + +/***/ "./src/fragments/Fragments.bs.js": +/*!***************************************!*\ + !*** ./src/fragments/Fragments.bs.js ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar Js_exn = __webpack_require__(/*! bs-platform/lib/js/js_exn.js */ \"./node_modules/bs-platform/lib/js/js_exn.js\");\nvar Js_dict = __webpack_require__(/*! bs-platform/lib/js/js_dict.js */ \"./node_modules/bs-platform/lib/js/js_dict.js\");\nvar Js_json = __webpack_require__(/*! bs-platform/lib/js/js_json.js */ \"./node_modules/bs-platform/lib/js/js_json.js\");\nvar Js_option = __webpack_require__(/*! bs-platform/lib/js/js_option.js */ \"./node_modules/bs-platform/lib/js/js_option.js\");\nvar Caml_option = __webpack_require__(/*! bs-platform/lib/js/caml_option.js */ \"./node_modules/bs-platform/lib/js/caml_option.js\");\n\nvar ppx_printed_query = \"fragment person on Person {\\nid \\nname \\nage \\n}\\n\";\n\nfunction parse(value) {\n var value$1 = Js_option.getExn(Js_json.decodeObject(value));\n var value$2 = Js_dict.get(value$1, \"id\");\n var tmp;\n if (value$2 !== undefined) {\n var value$3 = Caml_option.valFromOption(value$2);\n var value$4 = Js_json.decodeString(value$3);\n tmp = value$4 !== undefined ? value$4 : Js_exn.raiseError(\"graphql_ppx: Expected string, got \" + JSON.stringify(value$3));\n } else {\n tmp = Js_exn.raiseError(\"graphql_ppx: Field id on type Person is missing\");\n }\n var value$5 = Js_dict.get(value$1, \"name\");\n var tmp$1;\n if (value$5 !== undefined) {\n var value$6 = Caml_option.valFromOption(value$5);\n var value$7 = Js_json.decodeString(value$6);\n tmp$1 = value$7 !== undefined ? value$7 : Js_exn.raiseError(\"graphql_ppx: Expected string, got \" + JSON.stringify(value$6));\n } else {\n tmp$1 = Js_exn.raiseError(\"graphql_ppx: Field name on type Person is missing\");\n }\n var value$8 = Js_dict.get(value$1, \"age\");\n var tmp$2;\n if (value$8 !== undefined) {\n var value$9 = Caml_option.valFromOption(value$8);\n var value$10 = Js_json.decodeNumber(value$9);\n tmp$2 = value$10 !== undefined ? value$10 | 0 : Js_exn.raiseError(\"graphql_ppx: Expected int, got \" + JSON.stringify(value$9));\n } else {\n tmp$2 = Js_exn.raiseError(\"graphql_ppx: Field age on type Person is missing\");\n }\n return {\n id: tmp,\n name: tmp$1,\n age: tmp$2\n };\n}\n\nfunction ret_type(f) {\n return { };\n}\n\nvar MT_Ret = { };\n\nvar Person = {\n ppx_printed_query: ppx_printed_query,\n query: ppx_printed_query,\n parse: parse,\n name: \"person\",\n ret_type: ret_type,\n MT_Ret: MT_Ret\n};\n\nvar PersonFragment = {\n Person: Person\n};\n\nvar ppx_printed_query$1 = \"fragment person on Person {\\nid \\n}\\n\";\n\nfunction parse$1(value) {\n var value$1 = Js_option.getExn(Js_json.decodeObject(value));\n var value$2 = Js_dict.get(value$1, \"id\");\n var tmp;\n if (value$2 !== undefined) {\n var value$3 = Caml_option.valFromOption(value$2);\n var value$4 = Js_json.decodeString(value$3);\n tmp = value$4 !== undefined ? value$4 : Js_exn.raiseError(\"graphql_ppx: Expected string, got \" + JSON.stringify(value$3));\n } else {\n tmp = Js_exn.raiseError(\"graphql_ppx: Field id on type Person is missing\");\n }\n return {\n id: tmp\n };\n}\n\nfunction ret_type$1(f) {\n return { };\n}\n\nvar MT_Ret$1 = { };\n\nvar Person$1 = {\n ppx_printed_query: ppx_printed_query$1,\n query: ppx_printed_query$1,\n parse: parse$1,\n name: \"person\",\n ret_type: ret_type$1,\n MT_Ret: MT_Ret$1\n};\n\nvar PersonIdFragment = {\n Person: Person$1\n};\n\nvar ppx_printed_query$2 = \"fragment person on Person {\\nage \\n}\\n\";\n\nfunction parse$2(value) {\n var value$1 = Js_option.getExn(Js_json.decodeObject(value));\n var value$2 = Js_dict.get(value$1, \"age\");\n var tmp;\n if (value$2 !== undefined) {\n var value$3 = Caml_option.valFromOption(value$2);\n var value$4 = Js_json.decodeNumber(value$3);\n tmp = value$4 !== undefined ? value$4 | 0 : Js_exn.raiseError(\"graphql_ppx: Expected int, got \" + JSON.stringify(value$3));\n } else {\n tmp = Js_exn.raiseError(\"graphql_ppx: Field age on type Person is missing\");\n }\n return {\n age: tmp\n };\n}\n\nfunction ret_type$2(f) {\n return { };\n}\n\nvar MT_Ret$2 = { };\n\nvar Person$2 = {\n ppx_printed_query: ppx_printed_query$2,\n query: ppx_printed_query$2,\n parse: parse$2,\n name: \"person\",\n ret_type: ret_type$2,\n MT_Ret: MT_Ret$2\n};\n\nvar PersonAgeFragment = {\n Person: Person$2\n};\n\nexports.PersonFragment = PersonFragment;\nexports.PersonIdFragment = PersonIdFragment;\nexports.PersonAgeFragment = PersonAgeFragment;\n/* No side effect */\n\n\n//# sourceURL=webpack:///./src/fragments/Fragments.bs.js?"); + +/***/ }), + +/***/ "./src/fragments/LoadMoreFragments.bs.js": +/*!***********************************************!*\ + !*** ./src/fragments/LoadMoreFragments.bs.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE\n\n\nvar Curry = __webpack_require__(/*! bs-platform/lib/js/curry.js */ \"./node_modules/bs-platform/lib/js/curry.js\");\nvar React = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\nvar Js_exn = __webpack_require__(/*! bs-platform/lib/js/js_exn.js */ \"./node_modules/bs-platform/lib/js/js_exn.js\");\nvar Js_dict = __webpack_require__(/*! bs-platform/lib/js/js_dict.js */ \"./node_modules/bs-platform/lib/js/js_dict.js\");\nvar Js_json = __webpack_require__(/*! bs-platform/lib/js/js_json.js */ \"./node_modules/bs-platform/lib/js/js_json.js\");\nvar Js_option = __webpack_require__(/*! bs-platform/lib/js/js_option.js */ \"./node_modules/bs-platform/lib/js/js_option.js\");\nvar ApolloHooks = __webpack_require__(/*! reason-apollo-hooks/src/ApolloHooks.bs.js */ \"./node_modules/reason-apollo-hooks/src/ApolloHooks.bs.js\");\nvar Caml_option = __webpack_require__(/*! bs-platform/lib/js/caml_option.js */ \"./node_modules/bs-platform/lib/js/caml_option.js\");\nvar Persons$ReactHooksTemplate = __webpack_require__(/*! ../Persons.bs.js */ \"./src/Persons.bs.js\");\nvar Fragments$ReactHooksTemplate = __webpack_require__(/*! ./Fragments.bs.js */ \"./src/fragments/Fragments.bs.js\");\n\nvar ppx_printed_query = \"query getAllPersons($skip: Int!, $first: Int!) {\\nallPersons(skip: $skip, first: $first) {\\n...\" + Fragments$ReactHooksTemplate.PersonFragment.Person.name + \" \\n}\\n\\n}\\n\" + Fragments$ReactHooksTemplate.PersonFragment.Person.query;\n\nfunction parse(value) {\n var value$1 = Js_option.getExn(Js_json.decodeObject(value));\n var value$2 = Js_dict.get(value$1, \"allPersons\");\n return {\n allPersons: value$2 !== undefined ? Js_option.getExn(Js_json.decodeArray(Caml_option.valFromOption(value$2))).map((function (value) {\n return Curry._1(Fragments$ReactHooksTemplate.PersonFragment.Person.parse, value);\n })) : Js_exn.raiseError(\"graphql_ppx: Field allPersons on type Query is missing\")\n };\n}\n\nfunction make(skip, first, param) {\n return {\n query: ppx_printed_query,\n variables: Js_dict.fromArray([\n /* tuple */[\n \"skip\",\n skip\n ],\n /* tuple */[\n \"first\",\n first\n ]\n ].filter((function (param) {\n return !Js_json.test(param[1], /* Null */5);\n }))),\n parse: parse\n };\n}\n\nfunction makeWithVariables(variables) {\n var skip = variables.skip;\n var first = variables.first;\n return {\n query: ppx_printed_query,\n variables: Js_dict.fromArray([\n /* tuple */[\n \"skip\",\n skip\n ],\n /* tuple */[\n \"first\",\n first\n ]\n ].filter((function (param) {\n return !Js_json.test(param[1], /* Null */5);\n }))),\n parse: parse\n };\n}\n\nfunction makeVariables(skip, first, param) {\n return Js_dict.fromArray([\n /* tuple */[\n \"skip\",\n skip\n ],\n /* tuple */[\n \"first\",\n first\n ]\n ].filter((function (param) {\n return !Js_json.test(param[1], /* Null */5);\n })));\n}\n\nfunction definition_002(graphql_ppx_use_json_variables_fn, skip, first, param) {\n return Curry._1(graphql_ppx_use_json_variables_fn, Js_dict.fromArray([\n /* tuple */[\n \"skip\",\n skip\n ],\n /* tuple */[\n \"first\",\n first\n ]\n ].filter((function (param) {\n return !Js_json.test(param[1], /* Null */5);\n }))));\n}\n\nvar definition = /* tuple */[\n parse,\n ppx_printed_query,\n definition_002\n];\n\nfunction ret_type(f) {\n return { };\n}\n\nvar MT_Ret = { };\n\nvar GetAllPersonsQuery = {\n ppx_printed_query: ppx_printed_query,\n query: ppx_printed_query,\n parse: parse,\n make: make,\n makeWithVariables: makeWithVariables,\n makeVariables: makeVariables,\n definition: definition,\n ret_type: ret_type,\n MT_Ret: MT_Ret\n};\n\nfunction LoadMoreFragments(Props) {\n var match = ApolloHooks.useQuery(undefined, Caml_option.some(makeVariables(0, 5, undefined)), true, undefined, undefined, undefined, undefined, undefined, definition);\n var full = match[1];\n var handleLoadMore = function (param) {\n var data = full.data;\n var skip = data !== undefined ? Caml_option.valFromOption(data).allPersons.length : 0;\n Curry._3(full.fetchMore, Caml_option.some(makeVariables(skip, 5, undefined)), (function(prevResult, { fetchMoreResult, ...rest }) {\n if (!fetchMoreResult) return prevResult;\n return {\n ...fetchMoreResult,\n allPersons: prevResult.allPersons.concat(fetchMoreResult.allPersons)\n };\n }), undefined);\n \n };\n var data = full.data;\n return React.createElement(\"div\", {\n className: \"person-list\"\n }, data !== undefined ? React.createElement(React.Fragment, undefined, React.createElement(Persons$ReactHooksTemplate.make, {\n persons: Caml_option.valFromOption(data).allPersons\n }), React.createElement(\"button\", {\n disabled: full.networkStatus === /* FetchMore */2,\n onClick: handleLoadMore\n }, \"Load more\")) : (\n full.loading ? React.createElement(\"p\", undefined, \"Loading...\") : (\n full.error !== undefined ? React.createElement(\"p\", undefined, \"Error\") : React.createElement(\"p\", undefined, \"Not asked\")\n )\n ));\n}\n\nvar personsPerPage = 5;\n\nvar make$1 = LoadMoreFragments;\n\nexports.GetAllPersonsQuery = GetAllPersonsQuery;\nexports.personsPerPage = personsPerPage;\nexports.make = make$1;\n/* react Not a pure module */\n\n\n//# sourceURL=webpack:///./src/fragments/LoadMoreFragments.bs.js?"); + +/***/ }), + /***/ "./src/styles.css": /*!************************!*\ !*** ./src/styles.css ***! diff --git a/examples/persons/src/Root.re b/examples/persons/src/Root.re index e377b03..302fdc2 100644 --- a/examples/persons/src/Root.re +++ b/examples/persons/src/Root.re @@ -5,6 +5,7 @@ let filterName = "Bob"; type example = | LoadMore + | LoadMoreFragments | SubscribeToMore; [@react.component] @@ -43,6 +44,11 @@ let make = () => { onClick={_ => setActiveExample(_ => SubscribeToMore)}> {React.string("Subscribe to More")} +
{React.string("Loading...")}
+ | Data(data) => +{React.string("Error")}
+ }} +{React.string("Loading...")}
+ | {data: Some(data)} => + <> +{React.string("Error")}
+ | {error: None, data: None, loading: false} => +{React.string("Not asked")}
+ }} +