I have a simple implementation of graphQl on my api, but can't seem to get any other arguments than args from the resolvers. The code is pretty simple, so it shouldn't cause any issue :
const bindGraphqlModule = (app) => {
app.use(
"/graphql",
graphqlHTTP(() => {
return {
schema: graphQLSchema,
rootValue: resolvers,
context: {
test: "hi ?"
},
graphiql: process.env.NODE_ENV !== "production",
};
})
);
};
and then my resolver :
const resolver = async (args, context, test) => {
console.log(context, test);
const { email, password } = args;
...
Args are accessible normally, but context and test are both undefined. Any clue ?