gqlgen icon indicating copy to clipboard operation
gqlgen copied to clipboard

How to send a message to a specific subscriber among the subscribers?

Open namiomiru opened this issue 2 years ago • 0 comments

Hi everyone. How to send a message to a specific subscriber among the subscribers?

func (r *subscriptionResolver) Message(ctx context.Context) (<-chan string, error) {

	randomString := make(chan string, 1)
	go func() {
		<-ctx.Done()
	}()

	randomString <- randString(8)

	return randomString, nil
}

namiomiru avatar Sep 08 '22 06:09 namiomiru