Subscriptions Lambda Field Resolver

When using lambda field resolvers, like:

type Foo {
    currentTime: String! @lambda
}

and subscribing on Foo updates:

subscription {
    queryFoo {
       currentTime
     }
}

Following error is thrown:

An error occurred in subscription.
Error: Custom field `currentTime` is not supported in graphql subscription (Locations: [{Line: 3, Column: 5}])

This makes no sense to me. Lambda fields should also successfully resolve for subscriptions.

1 Like

yeah, this is not supported as of now because it may create a performance issue as lambda or custom field require network call. And subscriptions currently do polling to listen for any changes , and having the custom or lambda field reuire to make those many network calls.

But there are discussions to have the event-based design of subscriptions then i guess it will be easy to support.

I’ve imagined something like this.

How high is the priority for event-based subscriptions? As I mentioned in the other thread, I think it’s a must-have to be any useful.