Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL field batching failing on subscription #2164

Open
cristianonicolai opened this issue Aug 26, 2024 · 3 comments
Open

GraphQL field batching failing on subscription #2164

cristianonicolai opened this issue Aug 26, 2024 · 3 comments

Comments

@cristianonicolai
Copy link
Contributor

cristianonicolai commented Aug 26, 2024

I'm having an issue when using a @Subscription along with a batch @Source method. Seems like a potential regression on graphql. I've got a reproducer project here: https://github.com/cristianonicolai/graphql-playground . I also noticed that removing the batch, using a single entity as @Source code works fine, see https://github.com/cristianonicolai/graphql-playground/blob/main/src/main/java/org/acme/GraphQLResource.java#L41

Batch is not mandatory for the PlanDTO type in the subscription, since it will always return a single value. But since the same type is reused for a query, where batching makes sense, see plans query in the reproducer.

The issue started to happen once trying to upgrade Quarkus from version 3.12.3 to 3.13.3 (graphql-java 21.3 to 22.1.).

Although in the reproduces it logs an error BackPressureFailure: Could not emit tick 1 due to lack of requests, there is no error in the logs in the real application. It silintly fails to receive any items in the subscriber. Last related log in the app is:

2024-08-26 22:39:10,990 INFO  [io.sma.graphql] (vert.x-eventloop-thread-2) SRGQL011006: Payload Out [ExecutionResponse->ExecutionResultImpl{errors=[], data=graphql.execution.reactive.SubscriptionPublisher@713fd348, dataPresent=true, extensions=null}]
@smallrye smallrye deleted a comment Aug 26, 2024
@smallrye smallrye deleted a comment Aug 26, 2024
@simenbw
Copy link

simenbw commented Sep 26, 2024

I was also facing this issue.
It seems to be an error in graphql-java 22.1
graphql-java/graphql-java#3662

I locked graphql-java to version 22.2 and that fixed it.
I see smallrye-graphql already have bump version to 22.2
So issue seems to be that quarkus has not bumped smallrye-graphql version

@jmartisk
Copy link
Member

Thanks @simenbw for investigating this! If a graphql-java update fixes the problem, that's great.
Unfortunately, I tried getting SmallRye GraphQL 2.10 (and thus graphql-java 22.2) into Quarkus 3.15, but it was rejected. So this will be fixed in Quarkus 3.16.

@jmartisk
Copy link
Member

Or given that 3.15 will be LTS, I may be able to squeeze the graphql-java update there after all, into a later micro update. I'll try that :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants