Remove websocket sse GraphQL support

This commit is contained in:
Jan Eitzinger 2025-04-24 12:57:37 +02:00
parent acaad69917
commit aba75b3a19

View File

@ -32,7 +32,6 @@ import (
"github.com/ClusterCockpit/cc-backend/web" "github.com/ClusterCockpit/cc-backend/web"
"github.com/gorilla/handlers" "github.com/gorilla/handlers"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"github.com/gorilla/websocket"
httpSwagger "github.com/swaggo/http-swagger" httpSwagger "github.com/swaggo/http-swagger"
) )
@ -58,16 +57,16 @@ func serverInit() {
graphQLServer := handler.New( graphQLServer := handler.New(
generated.NewExecutableSchema(generated.Config{Resolvers: resolver})) generated.NewExecutableSchema(generated.Config{Resolvers: resolver}))
graphQLServer.AddTransport(transport.SSE{}) // graphQLServer.AddTransport(transport.SSE{})
graphQLServer.AddTransport(transport.POST{}) graphQLServer.AddTransport(transport.POST{})
graphQLServer.AddTransport(transport.Websocket{ // graphQLServer.AddTransport(transport.Websocket{
KeepAlivePingInterval: 10 * time.Second, // KeepAlivePingInterval: 10 * time.Second,
Upgrader: websocket.Upgrader{ // Upgrader: websocket.Upgrader{
CheckOrigin: func(r *http.Request) bool { // CheckOrigin: func(r *http.Request) bool {
return true // return true
}, // },
}, // },
}) // })
if os.Getenv("DEBUG") != "1" { if os.Getenv("DEBUG") != "1" {
// Having this handler means that a error message is returned via GraphQL instead of the connection simply beeing closed. // Having this handler means that a error message is returned via GraphQL instead of the connection simply beeing closed.