@merkur/plugin-graphql-client 0.32.0 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs CHANGED
@@ -33,10 +33,7 @@ function setEntityClasses(widget, entityClasses) {
33
33
  function graphqlClientPlugin() {
34
34
  return {
35
35
  async setup(widget) {
36
- widget = {
37
- ...graphqlClientAPI(),
38
- ...widget,
39
- };
36
+ core.assignMissingKeys(widget, graphqlClientAPI());
40
37
 
41
38
  widget.$in.graphqlClient = {
42
39
  endpointUrl: '',
@@ -48,7 +45,7 @@ function graphqlClientPlugin() {
48
45
  async create(widget) {
49
46
  if (ENV === DEV && !widget.$in.httpClient) {
50
47
  throw new Error(
51
- 'You must install missing plugin: npm i @merkur/plugin-http-client'
48
+ 'You must install missing plugin: npm i @merkur/plugin-http-client',
52
49
  );
53
50
  }
54
51
 
@@ -90,12 +87,12 @@ function graphqlClientAPI() {
90
87
  errors.some((error) => error.status === 'unauthorized')
91
88
  ) {
92
89
  return Promise.reject(
93
- new UnauthorizedError(`Unauthorized Error`, { errors, data })
90
+ new UnauthorizedError(`Unauthorized Error`, { errors, data }),
94
91
  );
95
92
  }
96
93
 
97
94
  return Promise.reject(
98
- new GraphQLError(`Api Error`, { errors, data })
95
+ new GraphQLError(`Api Error`, { errors, data }),
99
96
  );
100
97
  }
101
98
 
@@ -166,7 +163,7 @@ function addTypenameToSelections(document) {
166
163
  (selection) =>
167
164
  selection.kind === 'Field' &&
168
165
  (selection.name.value === '__typename' ||
169
- selection.name.value.lastIndexOf('__', 0) === 0)
166
+ selection.name.value.lastIndexOf('__', 0) === 0),
170
167
  );
171
168
 
172
169
  if (skip) {
package/lib/index.es9.cjs CHANGED
@@ -23,10 +23,7 @@ function setEntityClasses(widget, entityClasses) {
23
23
  function graphqlClientPlugin() {
24
24
  return {
25
25
  async setup(widget) {
26
- widget = {
27
- ...graphqlClientAPI(),
28
- ...widget
29
- };
26
+ core.assignMissingKeys(widget, graphqlClientAPI());
30
27
  widget.$in.graphqlClient = {
31
28
  endpointUrl: '',
32
29
  entityClasses: {}
package/lib/index.es9.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { bindWidgetToFunctions } from '@merkur/core';
1
+ import { assignMissingKeys, bindWidgetToFunctions } from '@merkur/core';
2
2
  import { stripIgnoredCharacters, print, visit } from 'graphql';
3
3
  import { GenericError } from '@merkur/plugin-error';
4
4
  class GraphQLError extends GenericError {}
@@ -21,10 +21,7 @@ function setEntityClasses(widget, entityClasses) {
21
21
  function graphqlClientPlugin() {
22
22
  return {
23
23
  async setup(widget) {
24
- widget = {
25
- ...graphqlClientAPI(),
26
- ...widget
27
- };
24
+ assignMissingKeys(widget, graphqlClientAPI());
28
25
  widget.$in.graphqlClient = {
29
26
  endpointUrl: '',
30
27
  entityClasses: {}
package/lib/index.js CHANGED
@@ -33,10 +33,7 @@ function setEntityClasses(widget, entityClasses) {
33
33
  function graphqlClientPlugin() {
34
34
  return {
35
35
  async setup(widget) {
36
- widget = {
37
- ...graphqlClientAPI(),
38
- ...widget,
39
- };
36
+ core.assignMissingKeys(widget, graphqlClientAPI());
40
37
 
41
38
  widget.$in.graphqlClient = {
42
39
  endpointUrl: '',
@@ -48,7 +45,7 @@ function graphqlClientPlugin() {
48
45
  async create(widget) {
49
46
  if (ENV === DEV && !widget.$in.httpClient) {
50
47
  throw new Error(
51
- 'You must install missing plugin: npm i @merkur/plugin-http-client'
48
+ 'You must install missing plugin: npm i @merkur/plugin-http-client',
52
49
  );
53
50
  }
54
51
 
@@ -90,12 +87,12 @@ function graphqlClientAPI() {
90
87
  errors.some((error) => error.status === 'unauthorized')
91
88
  ) {
92
89
  return Promise.reject(
93
- new UnauthorizedError(`Unauthorized Error`, { errors, data })
90
+ new UnauthorizedError(`Unauthorized Error`, { errors, data }),
94
91
  );
95
92
  }
96
93
 
97
94
  return Promise.reject(
98
- new GraphQLError(`Api Error`, { errors, data })
95
+ new GraphQLError(`Api Error`, { errors, data }),
99
96
  );
100
97
  }
101
98
 
@@ -166,7 +163,7 @@ function addTypenameToSelections(document) {
166
163
  (selection) =>
167
164
  selection.kind === 'Field' &&
168
165
  (selection.name.value === '__typename' ||
169
- selection.name.value.lastIndexOf('__', 0) === 0)
166
+ selection.name.value.lastIndexOf('__', 0) === 0),
170
167
  );
171
168
 
172
169
  if (skip) {
package/lib/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { bindWidgetToFunctions } from '@merkur/core';
1
+ import { assignMissingKeys, bindWidgetToFunctions } from '@merkur/core';
2
2
  import { stripIgnoredCharacters, print, visit } from 'graphql';
3
3
  import { GenericError } from '@merkur/plugin-error';
4
4
 
@@ -31,10 +31,7 @@ function setEntityClasses(widget, entityClasses) {
31
31
  function graphqlClientPlugin() {
32
32
  return {
33
33
  async setup(widget) {
34
- widget = {
35
- ...graphqlClientAPI(),
36
- ...widget,
37
- };
34
+ assignMissingKeys(widget, graphqlClientAPI());
38
35
 
39
36
  widget.$in.graphqlClient = {
40
37
  endpointUrl: '',
@@ -46,7 +43,7 @@ function graphqlClientPlugin() {
46
43
  async create(widget) {
47
44
  if (ENV === DEV && !widget.$in.httpClient) {
48
45
  throw new Error(
49
- 'You must install missing plugin: npm i @merkur/plugin-http-client'
46
+ 'You must install missing plugin: npm i @merkur/plugin-http-client',
50
47
  );
51
48
  }
52
49
 
@@ -88,12 +85,12 @@ function graphqlClientAPI() {
88
85
  errors.some((error) => error.status === 'unauthorized')
89
86
  ) {
90
87
  return Promise.reject(
91
- new UnauthorizedError(`Unauthorized Error`, { errors, data })
88
+ new UnauthorizedError(`Unauthorized Error`, { errors, data }),
92
89
  );
93
90
  }
94
91
 
95
92
  return Promise.reject(
96
- new GraphQLError(`Api Error`, { errors, data })
93
+ new GraphQLError(`Api Error`, { errors, data }),
97
94
  );
98
95
  }
99
96
 
@@ -164,7 +161,7 @@ function addTypenameToSelections(document) {
164
161
  (selection) =>
165
162
  selection.kind === 'Field' &&
166
163
  (selection.name.value === '__typename' ||
167
- selection.name.value.lastIndexOf('__', 0) === 0)
164
+ selection.name.value.lastIndexOf('__', 0) === 0),
168
165
  );
169
166
 
170
167
  if (skip) {
package/lib/index.umd.js CHANGED
@@ -1 +1 @@
1
- !function(r,e){if("function"==typeof define&&define.amd)define("@merkur/plugin-graphql-client",["exports","@merkur/core","graphql","@merkur/plugin-error"],e);else if("undefined"!=typeof exports)e(exports,require("@merkur/core"),require("graphql"),require("@merkur/plugin-error"));else{var t={exports:{}};e(t.exports,r.Merkur.Core,r.graphql,r.Merkur.Plugin.Error),r.merkurPluginGraphqlClient=t.exports}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:this,(function(r,e,t,n){Object.defineProperty(r,"__esModule",{value:!0}),r.UnauthorizedError=r.GraphQLError=void 0,r.graphqlClientPlugin=function(){return{setup:function(r){return d((function*(){return r=s(s({},{graphql:{request:function(r,e){var n=arguments;return d((function*(){var u,a=n.length>2&&void 0!==n[2]?n[2]:{},c=n.length>3&&void 0!==n[3]?n[3]:{},l=r.$in.graphqlClient,f=l.endpointUrl,p=l.entityClasses,y=c.headers,d=void 0===y?{}:y,b=c.body,v=void 0===b?{}:b,h=function(r,e){if(null==r)return{};var t,n,o=function(r,e){if(null==r)return{};var t,n,o={},i=Object.keys(r);for(n=0;n<i.length;n++)t=i[n],e.indexOf(t)>=0||(o[t]=r[t]);return o}(r,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(n=0;n<i.length;n++)t=i[n],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(r,t)&&(o[t]=r[t])}return o}(c,o);u=e,e=(0,t.visit)(u,{SelectionSet:{enter:function(r,e,t){if(!t||"OperationDefinition"!==t.kind){var n=r.selections;if(n&&!(n.some((function(r){return"Field"===r.kind&&("__typename"===r.name.value||0===r.name.value.lastIndexOf("__",0))}))||"Field"===t.kind&&t.directives&&t.directives.some((function(r){return"export"===r.name.value}))))return Object.assign({},r,{selections:[].concat(i(n),[S])})}}}});var m=(yield r.http.request(s({url:f,method:"POST",headers:s({"Content-Type":"application/json"},d),body:s({query:(0,t.stripIgnoredCharacters)((0,t.print)(e)),variables:a},v)},h))).response.body,g=m.errors,O=m.data,j=void 0===O?{}:O;return g?Array.isArray(g)&&g.some((function(r){return"unauthorized"===r.status}))?Promise.reject(new E("Unauthorized Error",{errors:g,data:j})):Promise.reject(new P("Api Error",{errors:g,data:j})):k(j,p)}))()}}}),r),r.$in.graphqlClient={endpointUrl:"",entityClasses:{}},r}))()},create:function(r){return d((function*(){if(q===_&&!r.$in.httpClient)throw new Error("You must install missing plugin: npm i @merkur/plugin-http-client");return(0,e.bindWidgetToFunctions)(r,r.graphql),r}))()}}},r.setEndpointUrl=function(r,e){r.$in.graphqlClient.endpointUrl=e},r.setEntityClasses=function(r,e){r.$in.graphqlClient.entityClasses=function(r){var e={};return r.forEach((function(r){var t=r.entityType;Array.isArray(t)||(t=[t]),t.forEach((function(t){return e[t]=r}))})),e}(e)};var o=["headers","body"];function i(r){return function(r){if(Array.isArray(r))return l(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||c(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(r){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},u(r)}function a(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var n,o,i,u,a=[],c=!0,l=!1;try{if(i=(t=t.call(r)).next,0===e){if(Object(t)!==t)return;c=!1}else for(;!(c=(n=i.call(t)).done)&&(a.push(n.value),a.length!==e);c=!0);}catch(r){l=!0,o=r}finally{try{if(!c&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(l)throw o}}return a}}(r,e)||c(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(r,e){if(r){if("string"==typeof r)return l(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?l(r,e):void 0}}function l(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function f(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function s(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?f(Object(t),!0).forEach((function(e){p(r,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}function p(r,e,t){return(e=h(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function y(r,e,t,n,o,i,u){try{var a=r[i](u),c=a.value}catch(r){return void t(r)}a.done?e(c):Promise.resolve(c).then(n,o)}function d(r){return function(){var e=this,t=arguments;return new Promise((function(n,o){var i=r.apply(e,t);function u(r){y(i,n,o,u,a,"next",r)}function a(r){y(i,n,o,u,a,"throw",r)}u(void 0)}))}}function b(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,h(n.key),n)}}function v(r,e,t){return e&&b(r.prototype,e),t&&b(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function h(r){var e=function(r,e){if("object"!==u(r)||null===r)return r;var t=r[Symbol.toPrimitive];if(void 0!==t){var n=t.call(r,e||"default");if("object"!==u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(r)}(r,"string");return"symbol"===u(e)?e:String(e)}function m(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function g(r,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&O(r,e)}function O(r,e){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},O(r,e)}function j(r){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(r){return!1}}();return function(){var t,n=w(r);if(e){var o=w(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return function(r,e){if(e&&("object"===u(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(r)}(this,t)}}function w(r){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},w(r)}var P=function(r){g(t,r);var e=j(t);function t(){return m(this,t),e.apply(this,arguments)}return v(t)}(n.GenericError);r.GraphQLError=P;var E=function(r){g(t,r);var e=j(t);function t(){return m(this,t),e.apply(this,arguments)}return v(t)}(P);r.UnauthorizedError=E;var S={kind:"Field",name:{kind:"Name",value:"__typename"}},_="development",q="undefined"!=typeof process&&process&&process.env?process.env.NODE_ENV:_;function k(r,e){var t={};if("string"==typeof r)return r;Object.entries(r).forEach((function(r){var n=a(r,2),o=n[0],i=n[1];Array.isArray(i)?i=i.map((function(r){return k(r,e)})):"object"===u(i)&&null!==i&&(i=k(i,e)),t[o]=i}));var n=t.__typename;return n&&e[n]?Reflect.construct(e[n],[t]):t}}));
1
+ !function(r,e){if("function"==typeof define&&define.amd)define("@merkur/plugin-graphql-client",["exports","@merkur/core","graphql","@merkur/plugin-error"],e);else if("undefined"!=typeof exports)e(exports,require("@merkur/core"),require("graphql"),require("@merkur/plugin-error"));else{var t={exports:{}};e(t.exports,r.Merkur.Core,r.graphql,r.Merkur.Plugin.Error),r.merkurPluginGraphqlClient=t.exports}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:this,(function(r,e,t,n){Object.defineProperty(r,"__esModule",{value:!0}),r.UnauthorizedError=r.GraphQLError=void 0,r.graphqlClientPlugin=function(){return{setup:function(r){return d((function*(){return(0,e.assignMissingKeys)(r,{graphql:{request:function(r,e){var n=arguments;return d((function*(){var u,a=n.length>2&&void 0!==n[2]?n[2]:{},c=n.length>3&&void 0!==n[3]?n[3]:{},l=r.$in.graphqlClient,f=l.endpointUrl,p=l.entityClasses,y=c.headers,d=void 0===y?{}:y,b=c.body,v=void 0===b?{}:b,h=function(r,e){if(null==r)return{};var t,n,o=function(r,e){if(null==r)return{};var t,n,o={},i=Object.keys(r);for(n=0;n<i.length;n++)t=i[n],e.indexOf(t)>=0||(o[t]=r[t]);return o}(r,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(n=0;n<i.length;n++)t=i[n],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(r,t)&&(o[t]=r[t])}return o}(c,o);u=e,e=(0,t.visit)(u,{SelectionSet:{enter:function(r,e,t){if(!t||"OperationDefinition"!==t.kind){var n=r.selections;if(n&&!(n.some((function(r){return"Field"===r.kind&&("__typename"===r.name.value||0===r.name.value.lastIndexOf("__",0))}))||"Field"===t.kind&&t.directives&&t.directives.some((function(r){return"export"===r.name.value}))))return Object.assign({},r,{selections:[].concat(i(n),[S])})}}}});var m=(yield r.http.request(s({url:f,method:"POST",headers:s({"Content-Type":"application/json"},d),body:s({query:(0,t.stripIgnoredCharacters)((0,t.print)(e)),variables:a},v)},h))).response.body,g=m.errors,O=m.data,j=void 0===O?{}:O;return g?Array.isArray(g)&&g.some((function(r){return"unauthorized"===r.status}))?Promise.reject(new E("Unauthorized Error",{errors:g,data:j})):Promise.reject(new P("Api Error",{errors:g,data:j})):k(j,p)}))()}}}),r.$in.graphqlClient={endpointUrl:"",entityClasses:{}},r}))()},create:function(r){return d((function*(){if(q===_&&!r.$in.httpClient)throw new Error("You must install missing plugin: npm i @merkur/plugin-http-client");return(0,e.bindWidgetToFunctions)(r,r.graphql),r}))()}}},r.setEndpointUrl=function(r,e){r.$in.graphqlClient.endpointUrl=e},r.setEntityClasses=function(r,e){r.$in.graphqlClient.entityClasses=function(r){var e={};return r.forEach((function(r){var t=r.entityType;Array.isArray(t)||(t=[t]),t.forEach((function(t){return e[t]=r}))})),e}(e)};var o=["headers","body"];function i(r){return function(r){if(Array.isArray(r))return l(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||c(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(r){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},u(r)}function a(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var n,o,i,u,a=[],c=!0,l=!1;try{if(i=(t=t.call(r)).next,0===e){if(Object(t)!==t)return;c=!1}else for(;!(c=(n=i.call(t)).done)&&(a.push(n.value),a.length!==e);c=!0);}catch(r){l=!0,o=r}finally{try{if(!c&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(l)throw o}}return a}}(r,e)||c(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(r,e){if(r){if("string"==typeof r)return l(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?l(r,e):void 0}}function l(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function f(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function s(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?f(Object(t),!0).forEach((function(e){p(r,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}function p(r,e,t){return(e=h(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function y(r,e,t,n,o,i,u){try{var a=r[i](u),c=a.value}catch(r){return void t(r)}a.done?e(c):Promise.resolve(c).then(n,o)}function d(r){return function(){var e=this,t=arguments;return new Promise((function(n,o){var i=r.apply(e,t);function u(r){y(i,n,o,u,a,"next",r)}function a(r){y(i,n,o,u,a,"throw",r)}u(void 0)}))}}function b(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,h(n.key),n)}}function v(r,e,t){return e&&b(r.prototype,e),t&&b(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function h(r){var e=function(r,e){if("object"!==u(r)||null===r)return r;var t=r[Symbol.toPrimitive];if(void 0!==t){var n=t.call(r,e||"default");if("object"!==u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(r)}(r,"string");return"symbol"===u(e)?e:String(e)}function m(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function g(r,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&O(r,e)}function O(r,e){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},O(r,e)}function j(r){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(r){return!1}}();return function(){var t,n=w(r);if(e){var o=w(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return function(r,e){if(e&&("object"===u(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(r)}(this,t)}}function w(r){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},w(r)}var P=function(r){g(t,r);var e=j(t);function t(){return m(this,t),e.apply(this,arguments)}return v(t)}(n.GenericError);r.GraphQLError=P;var E=function(r){g(t,r);var e=j(t);function t(){return m(this,t),e.apply(this,arguments)}return v(t)}(P);r.UnauthorizedError=E;var S={kind:"Field",name:{kind:"Name",value:"__typename"}},_="development",q="undefined"!=typeof process&&process&&process.env?process.env.NODE_ENV:_;function k(r,e){var t={};if("string"==typeof r)return r;Object.entries(r).forEach((function(r){var n=a(r,2),o=n[0],i=n[1];Array.isArray(i)?i=i.map((function(r){return k(r,e)})):"object"===u(i)&&null!==i&&(i=k(i,e)),t[o]=i}));var n=t.__typename;return n&&e[n]?Reflect.construct(e[n],[t]):t}}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkur/plugin-graphql-client",
3
- "version": "0.32.0",
3
+ "version": "0.34.0",
4
4
  "description": "Merkur event emitter plugin.",
5
5
  "main": "lib/index",
6
6
  "module": "lib/index",
@@ -51,10 +51,10 @@
51
51
  },
52
52
  "homepage": "https://merkur.js.org/",
53
53
  "devDependencies": {
54
- "@merkur/core": "^0.32.0",
55
- "@merkur/plugin-component": "^0.32.0",
56
- "@merkur/plugin-error": "^0.32.0",
57
- "@merkur/plugin-http-client": "^0.32.0"
54
+ "@merkur/core": "^0.34.0",
55
+ "@merkur/plugin-component": "^0.34.0",
56
+ "@merkur/plugin-error": "^0.34.0",
57
+ "@merkur/plugin-http-client": "^0.34.0"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "@merkur/core": "*",
@@ -65,5 +65,5 @@
65
65
  "graphql": "^16.6.0",
66
66
  "graphql-tag": "^2.12.6"
67
67
  },
68
- "gitHead": "c45ffe12725e3c4afcf7f13869a25a96f6807055"
68
+ "gitHead": "3bc4a1efb8f8d5cee6bcf5f1454809747904153c"
69
69
  }