-
Notifications
You must be signed in to change notification settings - Fork 95
Closed
Description
Hi there,
We've run into an issue whereby, we receive a ClassCastException when attempting to use any fluent methods of CompletableFuture.
For example:
// Given a data loader like so:
MyDataLoader<String, Try<MyType>> myDataLoader = ...;
// The following code will throw a ClassCastException because we unwrap the Try<MyType> here
// https://github.com/graphql-java/java-dataloader/blob/master/src/main/java/org/dataloader/DataLoader.java#L323-L332
return myDataLoader(myId)
.thenApply((Try<MyType> myPossibleValue) -> doSomethingWithValue(myPossibleValue));
The invocation of the thenApply
method fails because there is a ClassCastException: unable to cast MyType
to Try<MyType>
.
Metadata
Metadata
Assignees
Labels
No labels