graphql-java-kickstart/samples

webflux HelloQuery.java

pokebadgerswithspoon opened this issue · 3 comments

Yes, but with strange result.

import com.coxautodev.graphql.tools.GraphQLQueryResolver;
import org.springframework.stereotype.Component;
import reactor.core.publisher.Mono;

@Component
class HelloQuery implements GraphQLQueryResolver {

  public Mono<String> hello() {
      return Mono.just("Hello world. This is webflux");
  }
}

This results in

 "data": {
    "hello": "MonoJust"
  }

Thanks for update: 054492d#diff-4ec276d100cf531becadd23fecb2575c

Now I get it, the ingredient was to convert Mono to CompletableFuture, it works indeed.