-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
typescript-resolvers v4.2.1 causes error when typechecking: Maximum call stack size exceeded
#10084
Comments
Hi @dylanwulf , I found that the problem seems to stem from the custom Could you please let me know your use case with |
@eddeee888 We use |
I see @dylanwulf . Could you please show some code snippet how you'd set up Regarding, the |
Something is reallly different about typescript-resolvers 4.2.1, the types that were generated for my project were so inefficient that I couldn't even get typescript to build my project, I generated a trace and it ended up being 34GB, the build info wouldn't even write to a file because the size was > JSON.stringify allowed. vscode was also complaining about infinite types and my editor was totally janked as well. Downgraded to 4.1.0 and the problems disappeared. Not saying that I didn't somehow write my types in a way that was causing everything to blow up but I wasted two days trying to fix this and realized 4.2 was the issue. I was also using a |
Hi @kyle-villeneuve , could you please let me know the value of |
// codegen.config.ts defaultMapper: 'DeepPartialGQL<{T}>' // type definition export declare const __brand: unique symbol;
export type OpaqueType<T, K extends string = 'BRANDED_TYPE'> = T & { readonly [__brand]?: K };
type ValueOf<T> = T[keyof T];
export interface DeepPartialArray<T> extends Array<DeepPartialGQL<T>> {}
export declare type DeepPartialObject<T> = {
[P in keyof T]?: DeepPartialGQL<T[P]>;
} & { __typename?: string };
export declare type DeepPartialGQL<T> = T extends Function
? T
: T extends Array<infer U>
? DeepPartialArray<U>
: T extends ValueOf<Opaque>
? T | undefined | null
: T extends object
? DeepPartialObject<T>
: T | undefined | null; |
May I know the reason you are using |
@eddeee888 |
Thanks @kyle-villeneuve , have you tried using mappers? |
@eddeee888 I did yeah but that ended up being too restrictive for my use case |
I'll see what I can do 🙂 |
This is a bit confusing because both features are documented with the same level of importance and there's no indication provided other than this comment that users should avoid |
You are right, let me have a chat with the team to understand this a bit more. |
Hi all,
There's an alpha version here: |
@eddeee888 Thank you! That alpha version with the new option fixes the issue for me! |
This is fixed in |
thank you Eddeee! |
Which packages are impacted by your issue?
@graphql-codegen/typescript-resolvers
Describe the bug
With the v4.2.1 release of
@graphql-codegen/typescript-resolvers
, I started seeing an errorMaximum call stack size exceeded
when running the typescript compiler. This did not happen on v4.2.0.Your Example Website or App
https://github.com/dylanwulf/graphql-code-generator-issue-sandbox-template/tree/typescript-resolvers-max-call-stack-exceeded
Steps to Reproduce the Bug or Issue
typescript-resolvers-max-call-stack-exceeded
npm install
npm run codegen
(optional -- the types have already been generated and committed)npm run typecheck
Expected behavior
I expected no error
Screenshots or Videos
No response
Platform
graphql
version: seepackage.json
in linked github repo@graphql-codegen/*
version(s): seepackage.json
in linked github repoCodegen Config File
See linked github repo
Additional context
The full error output I see in the console:
The text was updated successfully, but these errors were encountered: