Odoo GraphQL Subscription using Node, Express JS for Sample
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
32 KiB

4 months ago
{"version":3,"file":"hoc.cjs","sources":["hoc-utils.js","query-hoc.js","mutation-hoc.js","subscription-hoc.js","graphql.js","withApollo.js"],"sourcesContent":["import { __extends } from \"tslib\";\nimport { invariant } from \"../../utilities/globals/index.js\";\nimport * as React from \"rehackt\";\nexport var defaultMapPropsToOptions = function () { return ({}); };\nexport var defaultMapResultToProps = function (props) { return props; };\nexport var defaultMapPropsToSkip = function () { return false; };\nexport function getDisplayName(WrappedComponent) {\n return WrappedComponent.displayName || WrappedComponent.name || \"Component\";\n}\nexport function calculateVariablesFromProps(operation, props) {\n var variables = {};\n for (var _i = 0, _a = operation.variables; _i < _a.length; _i++) {\n var _b = _a[_i], variable = _b.variable, type = _b.type;\n if (!variable.name || !variable.name.value)\n continue;\n var variableName = variable.name.value;\n var variableProp = props[variableName];\n if (typeof variableProp !== \"undefined\") {\n variables[variableName] = variableProp;\n continue;\n }\n // Allow optional props\n if (type.kind !== \"NonNullType\") {\n variables[variableName] = undefined;\n }\n }\n return variables;\n}\n// base class for hocs to easily manage refs\nvar GraphQLBase = /** @class */ (function (_super) {\n __extends(GraphQLBase, _super);\n function GraphQLBase(props) {\n var _this = _super.call(this, props) || this;\n _this.withRef = false;\n _this.setWrappedInstance = _this.setWrappedInstance.bind(_this);\n return _this;\n }\n GraphQLBase.prototype.getWrappedInstance = function () {\n invariant(this.withRef, 47);\n return this.wrappedInstance;\n };\n GraphQLBase.prototype.setWrappedInstance = function (ref) {\n this.wrappedInstance = ref;\n };\n return GraphQLBase;\n}(React.Component));\nexport { GraphQLBase };\n//# sourceMappingURL=hoc-utils.js.map","import { __assign, __extends, __rest } from \"tslib\";\nimport * as React from \"rehackt\";\nimport hoistNonReactStatics from \"hoist-non-react-statics\";\nimport { parser } from \"../parser/index.js\";\nimport { Query } from \"../components/index.js\";\nimport { getDisplayName, GraphQLBase, calculateVariablesFromProps, defaultMapPropsToOptions, defaultMapPropsToSkip, } from \"./hoc-utils.js\";\n/**\n * @deprecated\n * Official support for React Apollo higher order components ended in March 2020.\n * This library is still included in the `@apollo/client` package, but it no longer receives feature updates or bug fixes.\n */\nexport function withQuery(document, operationOptions) {\n if (operationOptions === void 0) { operationOptions = {}; }\n // this is memoized so if coming from `graphql` there is nearly no extra cost\n var operation = parser(document);\n // extract options\n var _a = operationOptions.options, options = _a === void 0 ? defaultMapPropsToOptions : _a, _b = operationOptions.skip, skip = _b === void 0 ? defaultMapPropsToSkip : _b, _c = operationOptions.alias, alias = _c === void 0 ? \"Apollo\" : _c;\n var mapPropsToOptions = options;\n if (typeof mapPropsToOptions !== \"function\") {\n mapPropsToOptions = function () { return options; };\n }\n var mapPropsToSkip = skip;\n if (typeof mapPropsToSkip !== \"function\") {\n mapPropsToSkip = function () { return skip; };\n }\n // allow for advanced referential equality checks\n var lastResultProps;\n return function (WrappedComponent) {\n var graphQLDisplayName = \"\".concat(alias, \"(\").concat(getDisplayName(WrappedComponent), \")\");\n var GraphQL = /** @class */ (function (_super) {\n __extends(GraphQL, _super);\n function GraphQL() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n GraphQL.prototype.render = function () {\n var _this = th