Closed nckswt closed 8 months ago
SafeError and isSafeError need to be in this list:
https://github.com/graphile/crystal/blob/main/grafast/grafast/src/index.ts#L431
Thanks! Is that something I can do at application level, did you want me to PR it, or will you have time to handle it and I'll keep an eye out for a version bump?
PR welcome, otherwise it’s on the list and will be addressed at some point. Weird that our tests haven’t caught it though.
(You could probably also address it via patch-package)
Failed attempt at reproduction here: https://github.com/benjie/crystal1921
thanks @benjie! I'll test it out and report back once I see a package bump
I'm going to close this because I think it's fixed; hopefully doing a release in the next few hours, failing that it'll be early next week. Please reopen if the next release doesn't fix the issue.
@benjie It fixed the issue for me, but I'm now getting the following error when I try to use the exported schema:
{
"errorType": "ReferenceError",
"errorMessage": "Cannot access 'nodeIdHandlerByTypeName' before initialization",
"stack": [
"ReferenceError: Cannot access 'nodeIdHandlerByTypeName' before initialization",
" at /var/task/src/graphql/index.js:8705:12",
" at Object.<anonymous> (/var/task/src/graphql/index.js:10160:12)",
" at Module._compile (node:internal/modules/cjs/loader:1356:14)",
" at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)",
" at Module.load (node:internal/modules/cjs/loader:1197:32)",
" at Module._load (node:internal/modules/cjs/loader:1013:12)",
" at Module.require (node:internal/modules/cjs/loader:1225:19)",
" at require (node:internal/modules/helpers:177:18)",
" at _tryRequireFile (file:///var/runtime/index.mjs:1002:37)",
" at _tryRequire (file:///var/runtime/index.mjs:1052:25)"
]
}
Looks to be tied to this issue: https://github.com/graphile/crystal/issues/1787
I'll keep this issue closed, but looks like #1787 will have to be reopened?
Summary
Trying to export a schema derived from a local PostgreSQL instance running with TimescaleDB. I'm planning on using a lambda handler and want to export the schema so we don't have to regenerate it on each API call.
Steps to reproduce
Expected results
I'd expect to see a
exported-schema.js
file that I could load into my handler.Actual results
I get the following error:
Additional context
I'm using:
Note that we're an NPM house using monorepos via npm workspaces, so it's not easy for me to swap over to yarn, and that wouldn't be a long-term solution for us.
Possible Solution
I tried adding
but
SafeError
doesn't exist in my codebase -- looks like it's a Grafast thing?I was able to
console.log
the result ofmakeSchema
but it doesn't get me much.