mirror of
https://github.com/aleleba/create-node-ts-graphql-server.git
synced 2025-06-20 04:48:24 -06:00
PR-727730: Updating packages and fixing sending the response in the context.
This commit is contained in:
5
src/@types/custom.d.ts
vendored
5
src/@types/custom.d.ts
vendored
@ -2,4 +2,9 @@
|
||||
declare module "*.gql" {
|
||||
const content: any;
|
||||
export default content;
|
||||
}
|
||||
|
||||
declare module 'cookie-parse' {
|
||||
const content: any;
|
||||
export default content;
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
import express from 'express'; //express
|
||||
// import { graphqlHTTP } from 'express-graphql';
|
||||
import { createHandler } from 'graphql-http/lib/use/express';
|
||||
import schema from '@src/GraphQL/schema';
|
||||
|
||||
@ -12,7 +11,10 @@ server.use(
|
||||
'/',
|
||||
createHandler({
|
||||
schema,
|
||||
context: (req, res) => ({ req, res })
|
||||
context(req) {
|
||||
const res = req.context.res
|
||||
return {req, res};
|
||||
},
|
||||
})
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user