mirror of
https://github.com/aleleba/create-node-ts-graphql-server.git
synced 2026-02-01 03:44:50 -06:00
PR-594489: Updating packages and changing playground.
This commit is contained in:
@@ -67,7 +67,7 @@ if(!checkedOut) process.exit(-1);
|
||||
|
||||
const actualVersion = runCommandWithOutput(`cd ${repoName} && node -p "require('./package.json').version"`).toString().trim()
|
||||
|
||||
const installDepsCommand = `cd ${repoName} && npm i --legacy-peer-deps`;
|
||||
const installDepsCommand = `cd ${repoName} && npm i`;
|
||||
const cleanGitHistoryCommand = `cd ${repoName} && rm -rf .git && git init && git add --all -- ":!.github" ":!bin" && git commit -m "Initial commit"`
|
||||
const cleanGitHistoryCommandWindows = `cd ${repoName} && rmdir .git /s /q && git init && git add --all -- ":!.github" ":!bin" && git commit -m "Initial commit"`
|
||||
const deleteFoldersCommand = `cd ${repoName} && rm -rf .github && rm -rf bin`
|
||||
|
||||
5197
package-lock.json
generated
5197
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@aleleba/create-node-ts-graphql-server",
|
||||
"version": "1.6.3",
|
||||
"version": "1.6.4",
|
||||
"description": "Node with Typescript and GraphQL Server",
|
||||
"bin": "./bin/cli.js",
|
||||
"main": "index.js",
|
||||
@@ -13,7 +13,7 @@
|
||||
"lint:fix": "eslint ./ --ext .js --ext .ts --fix",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
"check-updates": "npx npm-check-updates -u && npm i --legacy-peer-deps"
|
||||
"check-updates": "npx npm-check-updates -u && npm i"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -43,8 +43,8 @@
|
||||
"express": "^5.2.1",
|
||||
"graphql": "^16.12.0",
|
||||
"graphql-http": "^1.22.4",
|
||||
"graphql-playground-middleware-express": "^1.7.23",
|
||||
"graphql-scalars": "^1.25.0",
|
||||
"ruru": "^2.0.0-rc.4",
|
||||
"graphql-subscriptions": "^3.0.0",
|
||||
"graphql-tools": "^9.0.26",
|
||||
"graphql-ws": "^6.0.6",
|
||||
|
||||
6
src/@types/custom.d.ts
vendored
6
src/@types/custom.d.ts
vendored
@@ -11,4 +11,8 @@ declare module 'cookie-parse' {
|
||||
|
||||
declare module 'graphql-ws/use/ws' {
|
||||
export * from 'graphql-ws/dist/use/ws';
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'ruru/server' {
|
||||
export * from 'ruru/dist/server';
|
||||
}
|
||||
|
||||
15
src/index.ts
15
src/index.ts
@@ -8,7 +8,7 @@ import cookieParser from 'cookie-parser';
|
||||
import { useServer } from 'graphql-ws/use/ws';
|
||||
import { execute, subscribe } from 'graphql';
|
||||
import GraphQLserver from '@GraphQL/server';// Server of GraphQL,
|
||||
import expressPlayground from 'graphql-playground-middleware-express';
|
||||
import { ruruHTML } from 'ruru/server';
|
||||
import schema from '@GraphQL/schema';
|
||||
import { config } from '@config';
|
||||
import apiRouter from '@routes';
|
||||
@@ -36,13 +36,12 @@ app
|
||||
.use('/graphql', GraphQLserver);//Server of Graphql
|
||||
|
||||
if(config.PLAYGROUND_GRAPHQL === true){
|
||||
app.get('/playground', expressPlayground({
|
||||
endpoint: '/graphql',
|
||||
subscriptionEndpoint: '/graphql',
|
||||
settings: {
|
||||
'request.credentials': 'include', //Include Credentials for playground
|
||||
},
|
||||
}));
|
||||
app.get('/playground', (_req, res) => {
|
||||
res.type('html');
|
||||
res.end(ruruHTML({
|
||||
endpoint: '/graphql',
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
// DO NOT DO app.listen() unless we're testing this directly
|
||||
|
||||
Reference in New Issue
Block a user