Closed pahakrai closed 1 year ago
Hi @pahakrai. Sorry for the late answer.
It's hard to check what is the problem if I don't see the whole code but I've prepared a working example with graphql: nj-request-scope-graphql.zip based on this sample: https://github.com/nestjs/nest/tree/master/sample/23-graphql-code-first
npm i
npm run start
{
recipe(id: "1") {
id
title
}
}
Please let me know if this example helped you.
@kugacz thank you for pointing it out. I dug a little deeper to find it was global prefix setter issue, somehow the prefix for graphql and other restful api requires to be exact to pass information correctly into the request scope but it doesn't have issue with default request injection from nestjs. May be we can use the scope correctly no matter the request type. I am using useGlobalPrefix: true
settings in graph configuration in my service and have to update the graph path on gateway server
@kugacz Request scope is empty for graphql only works for the RESTful is there any way to update the request scope context. I am currently using the interceptor approach which doesn't seem to be clean