Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graphql-ws

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-ws - npm Package Compare versions

Comparing version 0.1.12 to 0.1.13

27

dist/server.js

@@ -20,3 +20,2 @@ "use strict";

const iterall_1 = require("iterall");
const promise_to_iterable_1 = require("./utils/promise-to-iterable");
const is_subscriptions_1 = require("./utils/is-subscriptions");

@@ -211,6 +210,6 @@ const common_1 = require("./common");

const document = typeof baseParams.query !== 'string' ? baseParams.query : graphql_1.parse(baseParams.query);
let executionIterable;
let executionPromise;
const validationErrors = graphql_1.validate(this.schema, document, this.specifiedRules);
if (validationErrors.length > 0) {
executionIterable = Promise.resolve(promise_to_iterable_1.createIterableFromPromise(Promise.resolve({ errors: validationErrors })));
executionPromise = Promise.resolve({ errors: validationErrors });
}

@@ -223,19 +222,7 @@ else {

connectionContext.filesIn[opId] = common_1.extractIncomingFiles(opId, connectionContext.socket, params.variables);
const promiseOrIterable = executor(this.schema, document, this.rootValue, params.context, params.variables, params.operationName);
if (!iterall_1.isAsyncIterable(promiseOrIterable) && promiseOrIterable instanceof Promise) {
executionIterable = promiseOrIterable;
}
else if (iterall_1.isAsyncIterable(promiseOrIterable)) {
executionIterable = Promise.resolve(promiseOrIterable);
}
else {
console.error('Invalid `execute` return type! Only Promise or AsyncIterable are valid values!');
SubscriptionServer.sendError(connectionContext, opId, {
message: 'GraphQL execute engine is not available',
});
}
executionPromise = Promise.resolve(executor(this.schema, document, this.rootValue, params.context, params.variables, params.operationName));
}
return executionIterable.then((ei) => ({
executionIterable: iterall_1.isAsyncIterable(ei) ?
ei : iterall_1.createAsyncIterator([ei]),
return executionPromise.then((executionResult) => ({
executionIterable: iterall_1.isAsyncIterable(executionResult) ?
executionResult : iterall_1.createAsyncIterator([executionResult]),
params,

@@ -245,3 +232,3 @@ }));

let lastVal;
iterall_1.forAwaitEach(iterall_1.createAsyncIterator(executionIterable), (value) => {
iterall_1.forAwaitEach(executionIterable, (value) => {
let result = value;

@@ -248,0 +235,0 @@ connectionContext.filesOut[opId] = common_1.extractOutgoingFiles(result.data);

{
"name": "graphql-ws",
"version": "0.1.12",
"version": "0.1.13",
"description": "WebSocket transport for GraphQL",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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