PR-594489: Updating packages and changing playground.

This commit is contained in:
2026-01-24 02:43:48 +00:00
parent 4876077ae1
commit 3b5bbd2a9a
5 changed files with 5061 additions and 165 deletions

View File

@@ -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';
}

View File

@@ -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