This repository was archived by the owner on Dec 19, 2023. It is now read-only.
This repository was archived by the owner on Dec 19, 2023. It is now read-only.
GraphiQL "subscriptionsClient.subscribe is not a function" #220
Closed
Description
The Bug
When I try to subscribe through GraphiQL I see this error:
My Setup
I have a schema
type Query {
hello : String!
}
type Subscription {
helloWorld : String!
}
and resolvers (in Kotlin)
import com.coxautodev.graphql.tools.GraphQLQueryResolver
import com.coxautodev.graphql.tools.GraphQLSubscriptionResolver
import org.reactivestreams.Publisher
import org.springframework.stereotype.Component
import reactor.core.publisher.Flux
@Component
class Query : GraphQLQueryResolver {
fun hello() = "Hello World!"
}
@Component
class Subscription : GraphQLSubscriptionResolver {
fun helloWorld(): Publisher<String> = Flux.just("Hello", "World!")
}
and dependencies in build.gradle
dependencies {
compile 'com.graphql-java-kickstart:graphql-spring-boot-starter:5.7.0'
runtime 'com.graphql-java-kickstart:graphiql-spring-boot-starter:5.7.0'
}
Extra Info
Queries Work
Subscriptions Work With Version 5.6.0
The last versions for subscriptions to work with GraphiQL seems to be 5.6.0
:
dependencies {
compile 'com.graphql-java-kickstart:graphql-spring-boot-starter:5.6.0'
runtime 'com.graphql-java-kickstart:graphiql-spring-boot-starter:5.6.0'
}