I am using java 17, spring-boot: 3.0.5 and maven in my project. I am calling a GraphQL endpoint using HttpGraphQlClient. Below is my expected code snippet: Mono<Entity> entity = this.graphQlClient.documentName("getDetails").variables(Map.of("xx", "xx")) .retrieve("data") .toEntity(Entity.class) .onErrorResume(FieldAccessException.class, ex -> { ClientGraphQlResponse response = ex.getResponse(); // ... ClientResponseField field = ex.getField(); // ... });However, I am getting syntax error at onErrorResume(....). Below is the error I am getting: Cannot resolve method 'onErrorResume(Class, )' Below are the suggestions I get: Candidates for method call this.graphQlClient.documentName("getDetails").variables(Map.of("xx", "xx")) .retrieve("data") .toEntity(Entity.class).onErrorResume(FieldAccessException.class, ex -> { }) are: Mono onErrorResume(Function<? super Throwable, ? extends Mono<? extends TransactionEntity>>) Mono onErrorResume(Class, Function<? super FieldAccessException, ? extends Mono<? extends TransactionEntity>>) Mono onErrorResume(Predicate<? super Throwable>, Function<? super Throwable, ? extends Mono<? extends TransactionEntity>>) Spring documention has the same code block given as example: I would like to know how to fix this error? How to handle error using retrieve method ? I want to handle error thrown from graphQL endpoint in an effective manner. Eventhough, we can use .execute() method to have more control on the GraphQL response, I wanted to use .retrieve() since it is provided in the library. (责任编辑:) |