dotansimha / dotansimha/graphql-code-generator-community
ClassCastException when using a complex input collection
- Dominant language
- TypeScript
- Stars
- 137
- Forks
- 195
- Avg merge
- 6h 20m
- Merged PRs (30d)
- 16
Description
### 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_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.