Skip to content

Commit f5283a4

Browse files
committed
fixed middlewares & pinned graphql-playground-react version
1 parent 979b215 commit f5283a4

File tree

10 files changed

+19
-28
lines changed

10 files changed

+19
-28
lines changed

packages/graphql-playground-middleware-express/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
"typescript": "2.6.2"
3535
},
3636
"dependencies": {
37-
"graphql-playground-html": "1.4.2",
38-
"graphql-playground-middleware": "^1.2.1-beta.6"
37+
"graphql-playground-html": "1.4.2"
3938
},
4039
"typings": "dist/index.d.ts",
4140
"typescript": {

packages/graphql-playground-middleware-express/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
} from 'graphql-playground-html'
77

88
/* tslint:disable */
9-
const { version, playgroundVersion } = require('../package.json')
9+
const { playgroundVersion } = require('../package.json')
1010

1111
export type ExpressPlaygroundMiddleware = (
1212
req: Request,
@@ -21,7 +21,7 @@ export type Register = (
2121
const express: Register = function voyagerExpress(options: MiddlewareOptions) {
2222
const middlewareOptions: RenderPageOptions = {
2323
...options,
24-
version: playgroundVersion || version,
24+
version: playgroundVersion,
2525
}
2626

2727
return async (req, res, next) => {

packages/graphql-playground-middleware-hapi/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"files": [
1515
"dist"
1616
],
17+
"playgroundVersion": "1.3.21",
1718
"scripts": {
1819
"build": "rimraf dist && tsc",
1920
"prepare": "npm run build"
@@ -38,7 +39,6 @@
3839
"definition": "dist/index.d.ts"
3940
},
4041
"dependencies": {
41-
"graphql-playground-html": "^1.3.6",
42-
"graphql-playground-middleware": "^1.2.1-beta.6"
42+
"graphql-playground-html": "^1.3.6"
4343
}
4444
}

packages/graphql-playground-middleware-hapi/src/index.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,16 @@ const hapi: Register = function(server, options: any, next) {
2727

2828
const middlewareOptions: RenderPageOptions = {
2929
...rest,
30-
version: pkg.version,
30+
version: pkg.playgroundVersion,
3131
}
3232

3333
server.route({
3434
method: 'GET',
3535
path,
3636
config,
37-
handler: (request, reply) => {
38-
reply(renderPlaygroundPage(middlewareOptions)).header(
39-
'Content-Type',
40-
'text/html',
41-
)
37+
handler: async (request, reply) => {
38+
const body = await renderPlaygroundPage(middlewareOptions)
39+
reply(body).header('Content-Type', 'text/html')
4240
},
4341
})
4442

packages/graphql-playground-middleware-koa/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"files": [
1515
"dist"
1616
],
17+
"playgroundVersion": "1.3.21",
1718
"scripts": {
1819
"build": "rimraf dist && tsc",
1920
"prepare": "npm run build"
@@ -39,7 +40,6 @@
3940
},
4041
"dependencies": {
4142
"graphql-playground-html": "^1.3.6",
42-
"graphql-playground-middleware": "^1.2.1-beta.6",
4343
"koa": "^2.4.1"
4444
}
4545
}

packages/graphql-playground-middleware-koa/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
} from 'graphql-playground-html'
77

88
/* tslint:disable-next-line */
9-
const { version } = require('../package.json')
9+
const { playgroundVersion } = require('../package.json')
1010

1111
export type KoaPlaygroundMiddleware = (ctx: Context, next: () => void) => void
1212

@@ -15,12 +15,12 @@ export type Register = (options: MiddlewareOptions) => KoaPlaygroundMiddleware
1515
const koa: Register = options => {
1616
const middlewareOptions: RenderPageOptions = {
1717
...options,
18-
version,
18+
version: playgroundVersion,
1919
}
2020

2121
return async function voyager(ctx, next) {
2222
try {
23-
ctx.body = renderPlaygroundPage(middlewareOptions)
23+
ctx.body = await renderPlaygroundPage(middlewareOptions)
2424
await next()
2525
} catch (err) {
2626
ctx.body = { message: err.message }

packages/graphql-playground-middleware-lambda/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"files": [
1515
"dist"
1616
],
17+
"playgroundVersion": "1.3.21",
1718
"scripts": {
1819
"build": "rimraf dist && tsc",
1920
"prepare": "npm run build"
@@ -38,7 +39,6 @@
3839
"definition": "dist/index.d.ts"
3940
},
4041
"dependencies": {
41-
"graphql-playground-html": "^1.3.6",
42-
"graphql-playground-middleware": "^1.2.1-beta.6"
42+
"graphql-playground-html": "^1.3.6"
4343
}
4444
}

packages/graphql-playground-middleware-lambda/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
} from 'graphql-playground-html'
77

88
/* tslint:disable-next-line */
9-
const { version } = require('../package.json')
9+
const { playgroundVersion } = require('../package.json')
1010

1111
export default function lambdaPlayground(options: MiddlewareOptions) {
1212
return async (
@@ -16,7 +16,7 @@ export default function lambdaPlayground(options: MiddlewareOptions) {
1616
) => {
1717
const middlewareOptions: RenderPageOptions = {
1818
...options,
19-
version,
19+
version: playgroundVersion,
2020
}
2121
const body = await renderPlaygroundPage(middlewareOptions)
2222
callback(null, {

scripts/release-react.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ middlewares=(
88
graphql-playground-middleware-express
99
# graphql-playground-middleware-hapi
1010
# graphql-playground-middleware-koa
11-
# graphql-playground-middleware-lambda
11+
graphql-playground-middleware-lambda
1212
)
1313

1414
cd graphql-playground-react
@@ -22,7 +22,7 @@ for middleware in "${middlewares[@]}"
2222
do
2323
cd $middleware
2424
echo "Releasing ${middleware}..."
25-
yarn add graphql-playground-react@$version
25+
cat package.json | jq ".playgroundVersion = \"$version\"" > package.json
2626
npm version patch --no-git-tag-version
2727
npm publish
2828
cd ..

yarn.lock

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4337,12 +4337,6 @@ graphql-language-service-utils@^1.0.16:
43374337
graphql-config "1.0.8"
43384338
graphql-language-service-types "^0.1.14"
43394339

4340-
graphql-playground-middleware@^1.2.1-beta.6:
4341-
version "1.2.1-beta.6"
4342-
resolved "https://registry.yarnpkg.com/graphql-playground-middleware/-/graphql-playground-middleware-1.2.1-beta.6.tgz#b302bda88d28fae716d127a483659c8e70a18776"
4343-
dependencies:
4344-
find-up "^2.1.0"
4345-
43464340
43474341
version "1.3.17"
43484342
resolved "https://registry.yarnpkg.com/graphql-playground/-/graphql-playground-1.3.17.tgz#1584bbcc948a7f9bac9399b9c269439da3086791"

0 commit comments

Comments
 (0)