PR-131297: removing express-graphql and use instead graphql-http, removing GraphiQL because of the lack of express middleware.

This commit is contained in:
2023-03-23 20:17:50 +00:00
parent 8e5b26ce96
commit 6a3458e022
7 changed files with 239 additions and 316 deletions

View File

@ -1,8 +1,8 @@
'use strict';
import express from 'express'; //express
import { graphqlHTTP } from 'express-graphql';
import { config } from '@config';
// import { graphqlHTTP } from 'express-graphql';
import { createHandler } from 'graphql-http/lib/use/express';
import schema from '@src/GraphQL/schema';
@ -10,13 +10,10 @@ const server = express.Router();//Router de Express
server.use(
'/',
graphqlHTTP( (req, res) => {
return {
schema,
graphiql: config.GRAPHIQL,
context: { req, res }
};
}),
createHandler({
schema,
context: (req, res) => ({ req, res })
})
);
// DO NOT DO app.listen() unless we're testing this directly