graphql-playground-middleware-koa
Advanced tools
Comparing version 1.3.6 to 1.3.7
@@ -0,1 +1,2 @@ | ||
/// <reference types="koa" /> | ||
import { Context } from 'koa'; | ||
@@ -2,0 +3,0 @@ import { MiddlewareOptions } from 'graphql-playground-html'; |
@@ -48,23 +48,26 @@ "use strict"; | ||
/* tslint:disable-next-line */ | ||
var version = require('../package.json').version; | ||
var playgroundVersion = require('../package.json').playgroundVersion; | ||
var koa = function (options) { | ||
var middlewareOptions = __assign({}, options, { version: version }); | ||
var middlewareOptions = __assign({}, options, { version: playgroundVersion }); | ||
return function voyager(ctx, next) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var err_1; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
var _a, err_1; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
_a.trys.push([0, 2, , 3]); | ||
ctx.body = graphql_playground_html_1.renderPlaygroundPage(middlewareOptions); | ||
_b.trys.push([0, 3, , 4]); | ||
_a = ctx; | ||
return [4 /*yield*/, graphql_playground_html_1.renderPlaygroundPage(middlewareOptions)]; | ||
case 1: | ||
_a.body = _b.sent(); | ||
return [4 /*yield*/, next()]; | ||
case 1: | ||
_a.sent(); | ||
return [3 /*break*/, 3]; | ||
case 2: | ||
err_1 = _a.sent(); | ||
_b.sent(); | ||
return [3 /*break*/, 4]; | ||
case 3: | ||
err_1 = _b.sent(); | ||
ctx.body = { message: err_1.message }; | ||
ctx.status = err_1.status || 500; | ||
return [3 /*break*/, 3]; | ||
case 3: return [2 /*return*/]; | ||
return [3 /*break*/, 4]; | ||
case 4: return [2 /*return*/]; | ||
} | ||
@@ -71,0 +74,0 @@ }); |
{ | ||
"name": "graphql-playground-middleware-koa", | ||
"version": "1.3.6", | ||
"homepage": | ||
"https://github.com/graphcool/graphql-playground/tree/master/packages/graphql-playground-middleware-koa", | ||
"description": | ||
"GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration).", | ||
"version": "1.3.7", | ||
"homepage": "https://github.com/graphcool/graphql-playground/tree/master/packages/graphql-playground-middleware-koa", | ||
"description": "GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration).", | ||
"contributors": [ | ||
@@ -16,8 +14,17 @@ "Tim Suchanek <tim@graph.cool>", | ||
"main": "dist/index.js", | ||
"files": ["dist"], | ||
"files": [ | ||
"dist" | ||
], | ||
"playgroundVersion": "1.3.22", | ||
"scripts": { | ||
"build": "tsc", | ||
"prepublishOnly": "npm run build" | ||
"build": "rimraf dist && tsc", | ||
"prepare": "npm run build" | ||
}, | ||
"keywords": ["graphql", "graphiql", "playground", "graphcool", "koa"], | ||
"keywords": [ | ||
"graphql", | ||
"graphiql", | ||
"playground", | ||
"graphcool", | ||
"koa" | ||
], | ||
"peerDependencies": { | ||
@@ -27,4 +34,5 @@ "koa": "^2.3.0" | ||
"devDependencies": { | ||
"@types/node": "^8.0.47", | ||
"typescript": "^2.6.1" | ||
"@types/node": "8.5.5", | ||
"rimraf": "2.6.2", | ||
"typescript": "2.6.2" | ||
}, | ||
@@ -37,5 +45,4 @@ "typings": "dist/index.d.ts", | ||
"graphql-playground-html": "^1.3.6", | ||
"graphql-playground-middleware": "^1.2.1-beta.6", | ||
"koa": "^2.4.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
3
6253
3
4
84
1
- Removedfind-up@2.1.0(transitive)
- Removedgraphql-playground-middleware@1.2.1-beta.6(transitive)
- Removedlocate-path@2.0.0(transitive)
- Removedp-limit@1.3.0(transitive)
- Removedp-locate@2.0.0(transitive)
- Removedp-try@1.0.0(transitive)
- Removedpath-exists@3.0.0(transitive)