Eventually, the issue was the absence of the following entry in application.properties:
spring.graphql.websocket.path=/graphql
I added this, and it started working.
I found this example from https://github.com/spring-projects/spring-graphql-examples