We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 31232c2 commit 73fa495Copy full SHA for 73fa495
examples/simple-server/main.go
@@ -31,7 +31,12 @@ func main() {
31
32
// Create subscription manager and GraphQL WS handler
33
subscriptionManager := graphqlws.NewSubscriptionManager(&schema)
34
- websocketHandler := graphqlws.NewHandler(subscriptionManager)
+ websocketHandler := graphqlws.NewHandler(graphqlws.HandlerConfig{
35
+ SubscriptionManager: subscriptionManager,
36
+ UserFromAuthToken: func(token string) (interface{}, error) {
37
+ return "Default user", nil
38
+ },
39
+ })
40
41
// Serve the GraphQL WS endpoint
42
http.Handle("/subscriptions", websocketHandler)
0 commit comments