I'm trying to build a monorepo of nestjs + svelte applications using nx, generated all applications and libraries using the CLI/nx commands.
Initially I thought this error is because the model is imported from a shared library but then I moved the definitions to the output of that graphql query right into the root resolver.
Just pnpm install
and pnpm start
then go to localhost:3100/graphql
and run:
query {
getHealth{
status
}
}
it throws:
{
"errors": [
{
"message": "status is not defined",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"getHealth"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"exception": {
"stacktrace": [
"ReferenceError: status is not defined",
" at RootResolver.getHealth (D:\\00 SOFTWARE\\temp\\nx-playground\\dist\\apps\\graphql-server\\webpack:\\nx-playground\\apps\\graphql-server\\src\\app\\resolvers\\root.resolver.ts:23:40)",
" at D:\\00 SOFTWARE\\temp\\nx-playground\\node_modules\\.pnpm\\@nestjs+core@9.0.8_j3qpqvsfitzwbryyelxorkuzfa\\node_modules\\@nestjs\\core\\helpers\\external-context-creator.js:70:33",
" at processTicksAndRejections (node:internal/process/task_queues:96:5)"
]
}
}
}
],
"data": null
}
Any ideas on why this is or how to get it working?