-
Notifications
You must be signed in to change notification settings - Fork 54
graphqlgen gives UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined
#449
Comments
Hey @devautor thanks for creating this. Are you able to share a repro that I can try? |
Hi again @jasonkuhrt Since I have no clue what's going on here, carving out a minimal repro would not be straightforward, but I will try as soon as I find some time. Thank you for your patience :) |
@devautor even if its a non-minimal repro, if you can share, it will still be useful probably! Thanks for all your participation to date by the way 🙏 |
I won't give to OSS my business app server code that is only possible due to the same OSS community :D @jasonkuhrt That means a lot! I am working towards founding a startup, and that dream stands on the shoulders of beautiful people like yourself. Thank you :) EDIT: I'm trying to put in a reproduction, because I want EDIT 2: I was using global install of
Yes, I am stupid! But, still have to get it working :) |
Hi @jasonkuhrt for the confusion, I had somehow missed it :( P.S. Sorry for all this trouble, but I just can't get |
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined
Thanks for updating the title, looks different than #436, lets keep this open 👍 |
@jasonkuhrt Have shared a repro for your night :) |
we managed to get the same error maybe it helps to know that commenting the following line from type Query node(id: ID!): Node and also commenting the entire code for the Node interface ... will fix the issue (even though i cannot say for sure it does not generate other issues) |
Same error here. Relevant files: graphqlgen.yml language: typescript
schema: ./prisma/prisma.graphql
context: ./src/index.ts:IApolloContext
output: ./src/generated/graphqlgen.ts
models:
files:
- ./src/generated/prisma-client/index.ts prisma/datamodel.prisma type User {
id: ID! @unique
email: String @unique
name: String!
posts: [Post!]!
}
type Post {
id: ID! @unique
title: String!
published: Boolean! @default(value: "false")
author: User
} src/index.ts export interface IApolloContext {
prisma: Prisma
} EDIT: |
EDIT: This issue was actually happening with version
0.4.0
which I was unknowingly executing withgraphqlgen
(global install), and realised when I didnpx graphqlgen
. Actual issue as the subject reads has been reported in this comment, and is requested to be taken up from there.Kindly find a reproduction throwing this error here: https://github.com/devautor/graphqlgen-repro-unhandledPromise
graphqlgen
execution gives me this error trace (out of heap memory):Also, for comparison,
graphql-code-generator
generates model types and resolvers from the same schema file successfully:Issue #310 earlier reported that this happens with huge schema, so to put in context, my
schema.graphql
is about 4k loc (introspected and downloaded fromprisma-playground
). Also, I am not usinggraphql-import
, but typescript files to define schema, and prisma generated types are not imported, but reused (since that issue mentions that as a possible source of error). Against this comment by @victorkangsh, I too am reusing nested structure from primsainput
types.Note: This has earlier been reported in issue #436 and was suggested to be posted independently.
The text was updated successfully, but these errors were encountered: