Graphcool / graphcool-framework

Apache License 2.0
1.77k stars 131 forks source link

Query to get Session/Subscriber count. #115

Open marktani opened 6 years ago

marktani commented 6 years ago

Issue by Plinpod Monday Jul 10, 2017 at 22:58 GMT Originally opened as https://github.com/graphcool/prisma/issues/307


It would be handy to be able to query and/or subscribe to a count of the currently active sessions with the backend or a count of the current subscribers to a particular table filter.

marktani commented 6 years ago

Comment by kbrandwijk Monday Jul 10, 2017 at 23:07 GMT


Some ideas to get the thought train going:

marktani commented 6 years ago

Comment by kbrandwijk Monday Jul 10, 2017 at 23:11 GMT


A current workaround would be:

marktani commented 6 years ago

Comment by Plinpod Monday Jul 10, 2017 at 23:23 GMT


In Socket.IO 1.4+ you can get this count like this

var room = io.sockets.adapter.rooms['my_room'];
room.length;

and I was hoping to replicate a similar functionality. It would allow for the most accurate client count.

marktani commented 6 years ago

Comment by marktani Monday Sep 18, 2017 at 09:50 GMT


Related to https://github.com/graphcool/graphcool/issues/126