Skip to content

Commit 77ab10b

Browse files
committed
subscription: added loop in subscriptabel schema
1 parent 183515e commit 77ab10b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

subscription.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,16 @@ func (self *SubscriptableSchema) Subscribe(ctx context.Context, queryString stri
4141
to := make(chan interface{})
4242
go func() {
4343
defer close(to)
44-
select {
45-
case <-ctx.Done():
46-
return
47-
case res, more := <-c:
48-
if !more {
44+
for {
45+
select {
46+
case <-ctx.Done():
4947
return
48+
case res, more := <-c:
49+
if !more {
50+
return
51+
}
52+
to <- res
5053
}
51-
to <- res
5254
}
5355
}()
5456
return to, nil

0 commit comments

Comments
 (0)