Skip to content

[Feature Request] Remove or parameterize the queue.length >= 10000 check #13471

@binary64

Description

@binary64

💻

  • Would you like to work on this feature?

What problem are you trying to solve?

I am using graphql-code-generator, which outputs a single .ts file. Problem is my API is very large, and I've just started to hit your hardcoded limit in node_modules/@babel/traverse/lib/context.js

if (testing && queue.length >= 10000) {
  this.trap = true;
}

This is causing a confusing "Infinite cycle detected."

I spent a lot of time digging deep into React looking for my infinite loop before I realized to look at the babel source to see the error I am seeing is potentially misleading.

Describe the solution you'd like

My 3 proposals are:

  1. Increase the limit to an arbitary 25000
  2. Rename the error for this particular trap to say "You are in test mode and we detected more than 25k items"
  3. Make this read from an options object or environment. Only if this does not exist, we fall back to 10k/25k.

Describe alternatives you've considered

Tried to "split" up this large generated .ts file, but was unable to do so.

Documentation, Adoption, Migration Strategy

TBA

Metadata

Metadata

Assignees

No one assigned

    Labels

    i: needs triageoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions