Skip to content

GraphQL: Error when iterating over undefined array #5923

Closed
@douglasmuraoka

Description

@douglasmuraoka

Issue Description

TypeError: Cannot read property 'map' of undefined when iterating over an undefined array

Steps to reproduce

  1. Create a custom class (named as "tests")
  2. Create an Array field (named as "arr")
  3. Leave this field value undefined (not null, not [])
  4. Execute the following GraphQL query:
query {
  objects {
    tests {
      arr {
        ...on Element {
          value
        }
      }
    }
  }
}

Expected Results

GraphQL query should execute.

Actual Outcome

TypeError: Cannot read property 'map' of undefined
parseClassTypes:652

Environment Setup

  • Server
    • parse-server version: 3.7.2
    • Localhost or remote server? localhost

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