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

graphql-extensions

Package Overview
Dependencies
Maintainers
2
Versions
170
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-extensions - npm Package Compare versions

Comparing version 0.1.0-beta.14 to 0.1.0-beta.15

16

lib/index.d.ts

@@ -17,2 +17,4 @@ import { GraphQLSchema, GraphQLError, GraphQLField, GraphQLFieldResolver, GraphQLResolveInfo, ExecutionArgs, DocumentNode } from 'graphql';

};
persistedQueryHit?: boolean;
persistedQueryRegister?: boolean;
}): EndHandler | void;

@@ -28,7 +30,3 @@ parsingDidStart?(o: {

graphqlResponse: GraphQLResponse;
responseInit: ResponseInit;
}): {
graphqlResponse?: GraphQLResponse;
responseInit?: ResponseInit;
} | void;
}): void;
willResolveField?(source: any, args: {

@@ -51,2 +49,4 @@ [argName: string]: any;

};
persistedQueryHit?: boolean;
persistedQueryRegister?: boolean;
}): EndHandler;

@@ -62,7 +62,3 @@ parsingDidStart(o: {

graphqlResponse: GraphQLResponse;
responseInit: ResponseInit;
}): {
graphqlResponse: GraphQLResponse;
responseInit: ResponseInit;
};
}): void;
willResolveField(source: any, args: {

@@ -69,0 +65,0 @@ [argName: string]: any;

@@ -30,16 +30,7 @@ "use strict";

GraphQLExtensionStack.prototype.willSendResponse = function (o) {
return this.extensions.reduce(function (prev, extension) {
this.extensions.forEach(function (extension) {
if (extension.willSendResponse) {
var result = extension.willSendResponse(o);
if (result) {
if (result.graphqlResponse) {
prev.graphqlResponse = result.graphqlResponse;
}
if (result.responseInit) {
prev.responseInit = result.responseInit;
}
}
extension.willSendResponse(o);
}
return prev;
}, o);
});
};

@@ -53,2 +44,3 @@ GraphQLExtensionStack.prototype.willResolveField = function (source, args, context, info) {

.filter(function (x) { return x; })
// Reverse list so that handlers "nest", like in handleDidStart.
.reverse();

@@ -55,0 +47,0 @@ return function (error, result) {

{
"name": "graphql-extensions",
"version": "0.1.0-beta.14",
"version": "0.1.0-beta.15",
"description": "Add extensions to GraphQL servers",

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

@@ -38,2 +38,4 @@ import {

variables?: { [key: string]: any };
persistedQueryHit?: boolean;
persistedQueryRegister?: boolean;
}): EndHandler | void;

@@ -46,6 +48,3 @@ public parsingDidStart?(o: { queryString: string }): EndHandler | void;

public willSendResponse?(o: {
graphqlResponse: GraphQLResponse;
responseInit: ResponseInit;
}): { graphqlResponse?: GraphQLResponse; responseInit?: ResponseInit } | void;
public willSendResponse?(o: { graphqlResponse: GraphQLResponse }): void;

@@ -77,2 +76,4 @@ public willResolveField?(

variables?: { [key: string]: any };
persistedQueryHit?: boolean;
persistedQueryRegister?: boolean;
}): EndHandler {

@@ -102,21 +103,8 @@ return this.handleDidStart(

public willSendResponse(o: {
graphqlResponse: GraphQLResponse;
responseInit: ResponseInit;
}): { graphqlResponse: GraphQLResponse; responseInit: ResponseInit } {
return this.extensions.reduce((prev, extension) => {
public willSendResponse(o: { graphqlResponse: GraphQLResponse }): void {
this.extensions.forEach(extension => {
if (extension.willSendResponse) {
const result = extension.willSendResponse(o);
if (result) {
if (result.graphqlResponse) {
prev.graphqlResponse = result.graphqlResponse;
}
if (result.responseInit) {
prev.responseInit = result.responseInit;
}
}
extension.willSendResponse(o);
}
return prev;
}, o);
});
}

@@ -123,0 +111,0 @@

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