Skip to content

ClassCastException when using a complex input collection #1094

@leonardehrenfried

Description

@leonardehrenfried

Which packages are impacted by your issue?

@graphql-codegen/java

Describe the bug

When generating an non-scalar, complex input value fetching it with the getter fails with the following error:

Exception while fetching data (/planConnection) : class java.util.LinkedHashMap cannot be cast to class org.opentripplanner.apis.gtfs.generated.GraphQLTypes$GraphQLPlanFilterInput (java.util.LinkedHashMap is in module java.base of loader 'bootstrap'; org.opentripplanner.apis.gtfs.generated.GraphQLTypes$GraphQLPlanFilterInput is in unnamed module of loader 'app')
java.lang.ClassCastException: class java.util.LinkedHashMap cannot be cast to class org.opentripplanner.apis.gtfs.generated.GraphQLTypes$GraphQLPlanFilterInput (java.util.LinkedHashMap is in module java.base of loader 'bootstrap'; org.opentripplanner.apis.gtfs.generated.GraphQLTypes$GraphQLPlanFilterInput is in unnamed module of loader 'app')

Your Example Website or App

https://github.com/opentripplanner/OpenTripPlanner/

Steps to Reproduce the Bug or Issue

  1. Generate complex input type
  2. Use getter
  3. See stacktrace

Expected behavior

The proper collection input type should be returned.

Screenshots or Videos

No response

Platform

  • OS: Linux
  • NodeJS: 222
  • graphql version: [e.g. 16.3.0]
  • @graphql-codegen/* version(s): [e.g. 2.6.2]

Codegen Config File

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions