You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.
When using the getGraphQLParams function inside a middleware function, the response hangs.
I've created a simple repo with the minimum required to replicate the issue here: https://github.com/mimo84/getGraphQLParamsBug
The code:
const express = require('express');
const graphql = require('express-graphql');
const {
GraphQLObjectType,
GraphQLSchema,
GraphQLString,
} = require('graphql');
const app = express();
const schema = new GraphQLSchema({
query: new GraphQLObjectType({
name: 'RootQueryType',
fields: {
oneField: {
type: GraphQLString,
resolve(parent, args) {
return 'oneField value';
},
},
},
})
});
app.use(async (req, res, next) => {
// just comment out this line to see the request being successful
const params = await graphql.getGraphQLParams(req);
console.log(params);
next();
});
app.use(
'/graphql',
graphql.graphqlHTTP({
schema,
graphiql: true,
})
);
app.listen(1234, () => {
console.log(`http://localhost:1234/graphql`);
});
Node Version: 15.6.0
OS: MacOS 11.2.1
The text was updated successfully, but these errors were encountered:
I tried an attempt to fix it and I've created a branch with the test, however it seems that I cannot reproduce the bug in the test. Do you think I am missing something?
When using the getGraphQLParams function inside a middleware function, the response hangs.
I've created a simple repo with the minimum required to replicate the issue here: https://github.com/mimo84/getGraphQLParamsBug
The code:
Node Version: 15.6.0
OS: MacOS 11.2.1
The text was updated successfully, but these errors were encountered: