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.15 to 0.1.0-rc.0

dist/index.d.ts

59

package.json
{
"name": "graphql-extensions",
"version": "0.1.0-beta.15",
"version": "0.1.0-rc.0",
"description": "Add extensions to GraphQL servers",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"clean": "rm -rf lib",
"clean": "rm -rf dist",
"compile": "tsc",
"watch": "tsc -w",
"prepare": "npm run clean && npm run compile",
"test": "./node_modules/.bin/jest",
"prepublish": "npm run clean && npm run compile",
"lint": "prettier -l 'src/**/*.ts' && tslint -p tsconfig.json 'src/**/*.ts'",

@@ -23,7 +22,8 @@ "lint-fix": "prettier --write 'src/**/*.ts' && tslint --fix -p tsconfig.json 'src/**/*.ts'"

"engines": {
"node": ">=4.0"
"node": ">=6.0"
},
"dependencies": {
"core-js": "^2.5.3",
"source-map-support": "^0.5.1"
"apollo-server-env": "^2.0.0-rc.6",
"core-js": "^2.5.7",
"source-map-support": "^0.5.6"
},

@@ -34,38 +34,11 @@ "peerDependencies": {

"devDependencies": {
"@types/graphql": "^0.12.6",
"@types/jest": "^22.2.2",
"@types/node": "^9.6.0",
"@types/graphql": "^0.13.1",
"@types/jest": "^23.1.2",
"@types/node": "^10.3.6",
"graphql": "^0.13.2",
"jest": "^22.4.3",
"jest-matcher-utils": "^22.4.3",
"prettier": "^1.12.1",
"ts-jest": "^22.4.2",
"tslint": "^5.10.0",
"typescript": "^2.8.3"
},
"prettier": {
"trailingComma": "all",
"singleQuote": true
},
"jest": {
"testEnvironment": "node",
"setupFiles": [
"<rootDir>/src/polyfills.js"
],
"testMatch": [
"**/test/**/*.(js|ts)",
"**/test/*.(js|ts)"
],
"testPathIgnorePatterns": [
"<rootDir>/node_modules/",
"<rootDir>/lib/"
],
"transform": {
"^.+\\.(ts|js)x?$": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"moduleFileExtensions": [
"ts",
"js"
]
"jest": "^23.2.0",
"jest-matcher-utils": "^23.2.0",
"ts-jest": "^22.4.6",
"tslint": "^5.10.0"
}
}

@@ -14,2 +14,5 @@ import {

import { Request } from 'apollo-server-env';
export { Request } from 'apollo-server-env';
export type EndHandler = (...errors: Array<Error>) => void;

@@ -48,3 +51,5 @@ // A StartHandlerInvoker is a function that, given a specific GraphQLExtension,

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

@@ -102,8 +107,16 @@ public willResolveField?(

public willSendResponse(o: { graphqlResponse: GraphQLResponse }): void {
this.extensions.forEach(extension => {
public willSendResponse(o: {
graphqlResponse: GraphQLResponse;
}): { graphqlResponse: GraphQLResponse } {
let reference = o;
// Reverse the array, since this is functions as an end handler
[...this.extensions].reverse().forEach(extension => {
if (extension.willSendResponse) {
extension.willSendResponse(o);
const result = extension.willSendResponse(reference);
if (result) {
reference = result;
}
}
});
return reference;
}

@@ -110,0 +123,0 @@

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