-
Notifications
You must be signed in to change notification settings - Fork 54
When graphqlgen large schema will get stuck #310
Comments
Supplement: graphqlgen
<--- Last few GCs --->
[14832:000002002A721AF0] 8948164 ms: Mark-sweep 1159.4 (1202.0) -> 1159.4 (1165.5) MB, 3679.4 / 0.0 ms last resort GC in old space requested
[14832:000002002A721AF0] 8948951 ms: Mark-sweep 1159.4 (1165.5) -> 1159.4 (1165.5) MB, 786.8 / 0.0 ms last resort GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0000038B35425EE1 <JSObject>
0: builtin exit frame: concat(this=000002C19A6AE511 <JSArray[40009211]>,000002C19A682201 <JSArray[18728217]>)
1: flatten(aka flatten) [C:\Users\T47\AppData\Roaming\npm\node_modules\graphqlgen\dist\utils.js:~49] [pc=000002BC79E8D883](this=0000006577382311 <undefined>,a=000002C19A6AE511 <JSArray[40009211]>,b=000002C19A682201 <JSArray[18728217]>)
2: arguments adaptor frame: 4->2
...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory And when I set --max_old_space_size setting it still not working. |
Same issue. Looks like it's in a loop of some kind. I am importing one type from Prisma via graphql-import. MacOS 10.14.1, 2015 iMac with 16gb RAM and 2016 MBP with 8gb RAM
|
@Victorkangsh Did you try downgrading to |
@mentrie Thanks for the suggestion. But if I downgrade, then I'm hit with the #280 bug 😢 |
@LawJolla Right. For the past 1hr, |
Same issue here. Can't use at all until this is resolved. My system has 32 GB of RAM, and it still doesn't work. Haven't let it run for an hour, but after several minutes I still have plenty of RAM left. |
I've spend few hours debugging the package and it seems that here : When i add Mutation to my schema with the same name as one in the |
that has been fixed. I've downgraded to |
@woss It's still an issue for me in 0.3.0. This project looked promising, but it now appears under maintained if not abandoned. I've given up and gone back to Javascript to actually get things built... pesky deadlines. :) |
Anyone have a schema that leads to this issue that they can share? |
@jasonkuhrt I have figured out its problem, it has nothing to do with the size of the schema, but an error when using the imported Input Type. when you add some Mutation using imported Input Type it will stuck: # import * from "./generated/prisma.graphql"
type Mutation {
addPaymentMethod(
data: PaymentCreateInput
): MutationResult!
book(
data: BookingCreateInput
): MutationResult!
} |
This bug renders graphqlgen unusable for me. Running with version 3 I get a bunch of TS errors while running on latest gets stuck. I was more specific with my imports from Prisma generated code.
Any hacky workaround ideas for now? A nightly I can test? |
Quick update: in VS code, using |
@Victorkangsh iiuc:
Did I get that right? |
@jasonkuhrt I think the problem is nested InputType. it's not work, and i copy in schema: |
https://github.com/vdiaz1130/graphqlgen-issue310 I copied over Prisma generated stuff and the schema (you wont be able to regen Prisma unless you configure all of that). |
|
To provide some more context. Added console.log to the array and the length does grow exponentially.
I could see that the type it's trying to parse is Mutation Would highly appreciate your help with this one |
Experiencing the same issue. Any updates on this? |
I worked around this by not importing from Prisma generated. I simply copied over my schema and removed all the Prisma specific things (@relation, @default, etc). Also using version 0.3.0 of graphqlgen. If in your Prisma generated code you have an error on the Model interface, delete the import and reimported via VS code "cmd + ." It should import from a ''prisma-client-lib/dist/types' - Fix this before you generate with graphqlgen. After generating with graphqlgen, If you get missing imports from your generated code and you are using VS Code, go next to a type, class, interface etc, then hit "cmd + ." Select "add all missing imports". |
Before considering this issue resolved I'd like to hear from multiple users if its their experience that the issue is resolved too. |
Thanks @jasonkuhrt ! Is there a particular release we should try? I still see 0.4.0 as the current. |
I added the line you added in the pull request to my local code. |
@LawJolla I'm not doing releases yet myself I'm afraid (might start to this or next month though) but maybe you could pull down from git repo (but build steps and all...). Given the diff is trivial what @atardadi did might be easiest. @atardadi thanks for the feedback! Good to know... -- Update Yeah, this issue is not resolved I'm pretty sure. I just pushed a commit that increased performance of the surrounding function by 6x (effect measured and tracked in benchmark history). It's just a microbenchmark improvement. The existing integration benchmarks did not improve. Sorry for false hope, still in the woods. I am however continuing to get a better grasp of codebase. Hopefully we'll close this soon! |
@vdiaz1130 thanks for the repo repro. I'd like to extract the minimal:
needed, and repro with the graphqlgen test suite. But, can you advise how I should get |
@Victorkangsh ok thanks for confirming, interesting... I think then, since this issue was originally created by you we should close it. Others have raised other issues here but going by your feedback, they are different issues. As such I would like to see them tracked as separate issues and have focused discussion. Does anyone strongly object? |
I don't mind, although I have the same issue - once my schema grew large it doesn't generate it for me. |
I haven't been doing that personally yet, though I think making a pre-release would be fine without much prep, however I don't think I have the required npm rights yet. |
@Victorkangsh was there a separate issue created for this? |
Description
In one of my projects, the datamodel has five hundred lines. My
schema.graphql
file imports the generatedprisma.graphql
schema file and has a hundred lines of Query and Mutation.I get stuck when I run graphqlgen. Cpu and memory are slightly higher. I noticed a prompt for the
find prettier
, but I still didn't succeed after removing the prettier configuration.My three computers have linux, mac, and windows systems, and they are not working properly. But the surprise is that my mac has been successful once, just once.
Steps to reproduce
When
schema.graphql
too large.My other small project run graphqlgen perfectly.
Expected results
Graphqlgen work success.
Actual results
Stucked. And console has no message.
Versions
The text was updated successfully, but these errors were encountered: