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
4.0 KiB
1 line
4.0 KiB
5 months ago
|
{"version":3,"file":"schema.cjs","sources":["index.js"],"sourcesContent":["import { __extends } from \"tslib\";\nimport { validate, execute } from \"graphql\";\nimport { ApolloLink } from \"../core/index.js\";\nimport { Observable } from \"../../utilities/index.js\";\nvar SchemaLink = /** @class */ (function (_super) {\n __extends(SchemaLink, _super);\n function SchemaLink(options) {\n var _this = _super.call(this) || this;\n _this.schema = options.schema;\n _this.rootValue = options.rootValue;\n _this.context = options.context;\n _this.validate = !!options.validate;\n return _this;\n }\n SchemaLink.prototype.request = function (operation) {\n var _this = this;\n return new Observable(function (observer) {\n new Promise(function (resolve) {\n return resolve(typeof _this.context === \"function\" ?\n _this.context(operation)\n : _this.context);\n })\n .then(function (context) {\n if (_this.validate) {\n var validationErrors = validate(_this.schema, operation.query);\n if (validationErrors.length > 0) {\n return { errors: validationErrors };\n }\n }\n return execute({\n schema: _this.schema,\n document: operation.query,\n rootValue: _this.rootValue,\n contextValue: context,\n variableValues: operation.variables,\n operationName: operation.operationName,\n });\n })\n .then(function (data) {\n if (!observer.closed) {\n observer.next(data);\n observer.complete();\n }\n })\n .catch(function (error) {\n if (!observer.closed) {\n observer.error(error);\n }\n });\n });\n };\n return SchemaLink;\n}(ApolloLink));\nexport { SchemaLink };\n//# sourceMappingURL=index.js.map"],"names":["__extends","Observable","validate","execute","ApolloLink"],"mappings":";;;;;;;;;AAIG,IAAC,UAAU,KAAkB,UAAU,MAAM,EAAE;AAClD,IAAIA,eAAS,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AAClC,IAAI,SAAS,UAAU,CAAC,OAAO,EAAE;AACjC,QAAQ,IAAI,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AAC9C,QAAQ,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AACtC,QAAQ,KAAK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