New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

apollo-link-reactive-schema

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-link-reactive-schema - npm Package Compare versions

Comparing version 2.0.3 to 2.1.0

27

lib/reactiveSchemaLink.js

@@ -17,3 +17,23 @@ "use strict";

var apollo_link_1 = require("apollo-link");
var graphql_1 = require("graphql");
var reactive_graphql_1 = require("reactive-graphql");
var rxjs_1 = require("rxjs");
var operators_1 = require("rxjs/operators");
// will transform the errors of the execution results provided by
// reactive-graphql in proper GraphQLErrors
function normalizeErrorsField(results) {
var _results = {};
_results.data = results.data;
if (results.errors) {
_results.errors = results.errors.map(function (message) {
// @ts-ignore just to be sure, message could be an instance of error
if (typeof message.message === 'string') {
// @ts-ignore
return new graphql_1.GraphQLError(message.message);
}
return new graphql_1.GraphQLError(message);
});
}
return _results;
}
var ReactiveSchemaLink = /** @class */ (function (_super) {

@@ -33,6 +53,9 @@ __extends(ReactiveSchemaLink, _super);

var context = typeof _this.context === 'function' ? _this.context(operation) : _this.context || {};
return reactive_graphql_1.graphql(_this.schema, operation.query, null, context, operation.variables).subscribe(observer);
return reactive_graphql_1.graphql(_this.schema, operation.query, null, context, operation.variables)
.pipe(operators_1.catchError(function (error) { return rxjs_1.of({ errors: [new graphql_1.GraphQLError(error.message)] }); }))
.pipe(operators_1.map(normalizeErrorsField))
.subscribe(observer);
}
catch (e) {
observer.error(e);
observer.next({ errors: [new graphql_1.GraphQLError(e.mesage)] });
}

@@ -39,0 +62,0 @@ });

2

package.json
{
"name": "apollo-link-reactive-schema",
"version": "2.0.3",
"version": "2.1.0",
"description": "Apollo Link that provides a reactive-graphql execution environment to perform operations on a provided reactive schema.",

@@ -5,0 +5,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc