graphql-extensions
Advanced tools
Comparing version 0.1.0-beta.15 to 0.1.0-rc.0
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8
24428
4
9
453
1
+ Addedapollo-server-env@2.4.5(transitive)
+ Addedarray-buffer-byte-length@1.0.1(transitive)
+ Addedarray.prototype.reduce@1.0.7(transitive)
+ Addedarraybuffer.prototype.slice@1.0.3(transitive)
+ Addedavailable-typed-arrays@1.0.7(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addeddata-view-buffer@1.0.1(transitive)
+ Addeddata-view-byte-length@1.0.1(transitive)
+ Addeddata-view-byte-offset@1.0.0(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddefine-properties@1.2.1(transitive)
+ Addedes-abstract@1.23.5(transitive)
+ Addedes-array-method-boxes-properly@1.0.0(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.0.0(transitive)
+ Addedes-set-tostringtag@2.0.3(transitive)
+ Addedes-to-primitive@1.2.1(transitive)
+ Addedfor-each@0.3.3(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedfunction.prototype.name@1.1.6(transitive)
+ Addedfunctions-have-names@1.2.3(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedget-symbol-description@1.0.2(transitive)
+ Addedglobalthis@1.0.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-bigints@1.0.2(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedinternal-slot@1.0.7(transitive)
+ Addedis-array-buffer@3.0.4(transitive)
+ Addedis-bigint@1.0.4(transitive)
+ Addedis-boolean-object@1.1.2(transitive)
+ Addedis-callable@1.2.7(transitive)
+ Addedis-data-view@1.0.1(transitive)
+ Addedis-date-object@1.0.5(transitive)
+ Addedis-negative-zero@2.0.3(transitive)
+ Addedis-number-object@1.0.7(transitive)
+ Addedis-regex@1.1.4(transitive)
+ Addedis-shared-array-buffer@1.0.3(transitive)
+ Addedis-string@1.0.7(transitive)
+ Addedis-symbol@1.0.4(transitive)
+ Addedis-typed-array@1.1.13(transitive)
+ Addedis-weakref@1.0.2(transitive)
+ Addedisarray@2.0.5(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedobject.assign@4.1.5(transitive)
+ Addedobject.getownpropertydescriptors@2.1.8(transitive)
+ Addedpossible-typed-array-names@1.0.0(transitive)
+ Addedregexp.prototype.flags@1.5.3(transitive)
+ Addedsafe-array-concat@1.1.2(transitive)
+ Addedsafe-regex-test@1.0.3(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedset-function-name@2.0.2(transitive)
+ Addedside-channel@1.0.6(transitive)
+ Addedstring.prototype.trim@1.2.9(transitive)
+ Addedstring.prototype.trimend@1.0.8(transitive)
+ Addedstring.prototype.trimstart@1.0.8(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedtyped-array-buffer@1.0.2(transitive)
+ Addedtyped-array-byte-length@1.0.1(transitive)
+ Addedtyped-array-byte-offset@1.0.2(transitive)
+ Addedtyped-array-length@1.0.6(transitive)
+ Addedunbox-primitive@1.0.2(transitive)
+ Addedutil.promisify@1.1.2(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
+ Addedwhich-boxed-primitive@1.0.2(transitive)
+ Addedwhich-typed-array@1.1.15(transitive)
Updatedcore-js@^2.5.7
Updatedsource-map-support@^0.5.6