google / rejoiner

Generates a unified GraphQL schema from gRPC microservices and other Protobuf sources
https://google.github.io/rejoiner/
Apache License 2.0
3.67k stars 139 forks source link

Support generating GraphQLOutputType from ListenableFuture<Scalar> type #69

Open qcbuyertools opened 5 years ago

qcbuyertools commented 5 years ago

This relates to https://github.com/google/rejoiner/issues/57 but is for a more specific use case.

From the comment: https://github.com/google/rejoiner/blob/68fa0f540afc75421418877eb42603aa8ca4e8ef/rejoiner/src/main/java/com/google/api/graphql/rejoiner/SchemaModule.java#L438-L442

We support type Message, any Scalar type, ImmutableList<Message>, ListenableFuture<? extends Message>, and ListenableFuture<ImmutableList<? extend Message>>, and there is a TODO trying to support ImmutableList<Scalar type>.

Our system is currently using a String return type for a @SchemaModification, and is trying to use ListnableFuture to improve our performance, and we want to wrap a String in a ListenableFuture, which means the method will have ListenableFuture<String> as the return type, which is currently not supported by the getReturnType.

From looking at the code I believe it's quite possible to add ListenableFuture<Scalar type>. Is there any concern of adding the support?

siderakis commented 5 years ago

No concerns, PRs welcome

Sent from my iPhone

On Feb 21, 2019, at 1:36 AM, qcbuyertools notifications@github.com wrote:

This relates to #57 but is for a more specific use case.

From the comment: https://github.com/google/rejoiner/blob/68fa0f540afc75421418877eb42603aa8ca4e8ef/rejoiner/src/main/java/com/google/api/graphql/rejoiner/SchemaModule.java#L438-L442

We support type Message, any Scalar type, ImmutableList, ListenableFuture<? extends Message>, and ListenableFuture<ImmutableList<? extend Message>>, and there is a TODO trying to support ImmutableList.

Our system is trying to use ListnableFuture to improve our performance, and we want to wrap a String in a ListenableFuture, which means the method will have ListenableFuture as the return type, which is currently not supported by the getReturnType.

From looking at the code I believe adding ListenableFuture should be relatively easy. Is there any concern of adding the support?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.