Replies: 6 comments 6 replies
-
I got it working by providing this bean in my app:
Should this perhaps be the default? |
Beta Was this translation helpful? Give feedback.
-
The |
Beta Was this translation helpful? Give feedback.
-
Hello we will take a look at this, in the meantime have you looked at TLTR;
so for now -- if you data fetcher / resolver returns a flow you can just simply interop to Flux |
Beta Was this translation helpful? Give feedback.
-
Yes, with Reactive Streams it works without any problem. I would be very keen on having Flow as the return type of my bean functions and be able to test them with Turbine, though. Thanks for your help! |
Beta Was this translation helpful? Give feedback.
-
Hello 👋 As a side note - instead of re-creating the whole config object you should be able to just create the hooks bean and it should autowire everything for you. I'll update the docs to reflect this. There are a few caveats though that may or may not be problematic for you
Personally I'd double check whether you really need subscriptions as they do have a number of drawbacks and in most cases |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for all the info, as a GraphQL newbie I wasn't aware of much of that! I'll change the way I override the NoOp hooks in Spring, but I reckon it could already be the default in Your comments about the drawbacks of subscriptions are very interesting. Could I bother you with a couple of extra questions?
|
Beta Was this translation helpful? Give feedback.
-
I'm trying to use the support for Flow in subscriptions, to avoid having to convert them to publisher as a last step in my functions. (Which seems to work perfectly fine, btw.)
If I write my subscription like
then I get this when executing
bootRun
:After reading the documentation, I reckon that the schema generation is using
NoopSchemaGeneratorHooks
. So I'm trying to enableFlowSubscriptionSchemaGeneratorHooks
by creating this class:and creating a
src/main/resources/META-INF/services/com.expediagroup.graphql.plugin.schema.hooks.SchemaGeneratorHooksProvider
file with this content:Nevertheless, nothing seems to change, and I still get the same error. Am I even going the right way about enabling this? The documentation just says that:
Any help would be very appreciated! :)
GraphQL-Kotlin: 6.0.0-alpha5
Spring Boot: 2.7.1
Java: 17
Beta Was this translation helpful? Give feedback.
All reactions