Skip to content

Instantly share code, notes, and snippets.


Ronny López ronnylt

View GitHub Profile
ronnylt / Event-stream based GraphQL
Created Aug 31, 2020 — forked from OlegIlyenko/Event-stream based GraphQL
Event-stream based GraphQL subscriptions for real-time updates
View Event-stream based GraphQL

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

View aggregate.go
package domain
// An Aggregate is a tree of object relations that protect business invariants (business rules).
// Concretely, an aggregates handle commands and have a state model encapsulated within it that allows
// it to implement the required command validation, thus upholding the invariants (business rules) of the aggregate.
// Aggregates are usually composed of several entities and values objects.
// The lifetimes of the components of an aggregate are bounded by the lifetime of the entire aggregate.
// Aggregate is abstract concept, it's just represented as an empty interface with no specific contract.
type Aggregate interface{}
View gist:98eb14055f72d3263dc1ad13c099a385
### Keybase proof
I hereby claim:
* I am ronnylt on github.
* I am ronnylt ( on keybase.
* I have a public key whose fingerprint is FE3B F389 D20C 1F39 487F 772A 65B5 6D4F 6D86 095E
To claim this, I am signing this object:
View gist:9191734
(feature/erlangmk●●)$ make
./rebar compile
==> json (compile)
ERROR: compile failed while processing /Users/ronnylt/workspace/sp/spchat-erlang/deps/json: {'EXIT',{badarg,[{re,split,
View gist:9076279
PROJECT = spine
DEPS = cowboy
dep_cowlib = pkg://cowlib 0.9.0
TEST_DEPS = ct_helper
dep_ct_helper = master
View gist:6711674
define('N', 1000);
class Redis
public function run($n)
$a = rand($n, 2 * $n);