Skip to content

RangeError encountered when recursive required argument is present in schema #41

@yahelnachum

Description

@yahelnachum

Schema:

input Args {
  first: Int
  recursive: Args!
}

type Order {
  id: ID
  date: String
}

type Query {
  orders(args: Args!): [Order]
}

Error seen when running test.

    RangeError: Maximum call stack size exceeded
        at Array.map (<anonymous>)

      150 |         // Identify requiredArguments
      151 |         const requiredArguments = Object.entries(fields)
    > 152 |           .map(([_, value]) => value)
          |            ^
      153 |           .filter((type) => {
      154 |             return considerArgument(type, config)
      155 |           })

      at getDefaultArgValue (src/provide-variables.ts:152:12)
      at getDefaultArgValue (src/provide-variables.ts:132:12)
      at src/provide-variables.ts:159:33
          at Array.reduce (<anonymous>)
      at getDefaultArgValue (src/provide-variables.ts:158:34)
      at getDefaultArgValue (src/provide-variables.ts:132:12)
      at src/provide-variables.ts:159:33
          at Array.reduce (<anonymous>)
      at getDefaultArgValue (src/provide-variables.ts:158:34)
      at getDefaultArgValue (src/provide-variables.ts:132:12)
      at src/provide-variables.ts:159:33
          at Array.reduce (<anonymous>)
          
... (repeats at least 20 times)

      at getDefaultArgValue (src/provide-variables.ts:158:34)
      at getDefaultArgValue (src/provide-variables.ts:132:12)
      at src/provide-variables.ts:159:33

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions