Closed gaurav-bothra closed 2 years ago
Hi @gaurav-bothra thanks for writing to us. Currently this library doesn't have out of the box support for GraphQL. Express and Fastify are supported. Feel free to raise a PR if you have ideas around how to implement the GraphQL support on this. Thanks 👍
Hi @sandeepsuvit,
I Just add try/catch in tenancy-core.module.ts file. It is working fine after adding below snippet
static getTenantFromRequest(isFastifyAdaptor, req, tenantIdentifier) {
var _a;
let tenantId = '';
if (isFastifyAdaptor) {
tenantId = ((_a = req.headers[`${tenantIdentifier || ''}`.toLowerCase()]) === null || _a === void 0 ? void 0 : _a.toString()) || '';
}
else {
try {
tenantId = req.get(`${tenantIdentifier}`) || '';
} catch(err) {
tenantId = req.req.get(`${tenantIdentifier}`) // For graphql
}
}
if (this.isEmpty(tenantId)) {
throw new common_1.BadRequestException(`${tenantIdentifier} is not supplied`);
}
return tenantId;
}
Hi,
I am trying to integrate nestjs-tenacy with graphql. I am getting the below error.