-
-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Callstack size exceeded for getCreateInput on PrismaCrudGenerator #993
Comments
The example generators are intentionally simplistic and are implemented in a way that should make it obvious they shouldn't be used as is. The implementation here is using a basic depth first crawl of types which naturally will result in exceeding stack depth limits on a sufficiently complex schema. The only real solution here is to write a generator that is a little smarter about how it generates types. You can also increase the stack depth limit in node, but thats just hacking around the underlying issue. The generator examples are meant as simplistic examples to get you started building a real generator, not as an actual solution to use in your production applications, and these types of issues won't be addressed in the examples. I've tried to be as clear as possible about this by not publishing it as a package, and adding warnings to the docs |
@hayes you were clear. "I know this is outside Pothos's scope..." We worked on the generator previously. I hope your day improves. |
Sorry, these generators have been a source of a lot a frustration and caused a disproportionately high support load. To give you a slightly better answer, the way to handle this is to use some sort of unrolling/trampoline pattern in the generator. More specifically, what I'd likely do is split up the You can also try |
I greatly appreciate it @hayes . I'm sorry to contribute to your frustration. I will work on it and try to contribute back. |
Hi Hayes and everyone. Thanks again for the amazing work.
I know this is outside Pothos's scope, but if anyone has thoughts I'd appreciate it.
I'm upgrading from Prisma 4.10 to 5.2 with
(I did try the following with Prisma 4.10 -- same issue)
I'm using the following generator. It's the same as published in the Pothos docs website except:
https://gist.github.com/LawJolla/3685374f3ef35cfb68219fbdf5abe570
When my app calls
prismaGenerator.getUpdateInput(...)
orprismaGenerator.getCreateInput(...)
I get the following errorI've tried debugging this (a lot of debugger use!) and it doesn't look like it's recursive.
For help in debugging, I put a console log at 263
console.log(model.fields.length, fullName)
and it appeared normal. Here's the log before the call stack error.And replacing console.log with console.trace gave this call stack before the crash.
Any thoughts are greatly appreciated!!
The text was updated successfully, but these errors were encountered: