More Related Content Similar to Expose your kafka with graphql (20) Expose your kafka with graphql15. www.openweb.nl
Query: extract data from derived state
query {
transactions_by_iban (
iban: “NL66OPEN0000000000”
max_items: 2) {
id
changed_by
}
}
{
“data”: {
“transactions_by_iban”: [
{ “id”: 27,
“changed_by” : “€12,34”},
{ “id”: 24,
“changed_by” : “€20,00”}
]
}
}
19. www.openweb.nl
Subscription: filter stream of events
subscription {
stream_transactions(
iban: “NL66OPEN0000000000”) {
id
changed_by
descr
}
}
{
“stream_transactions”: {
“id”: 33,
“changed_by”: “€74,59”,
“descr”: “after query”
}
}
22. www.openweb.nl
Subscription: command, return reaction(s)
subscription {
get_account(
username: “gklijs”,
password: “test1234”) {
iban
token
}
}
{
“get_account”: {
“iban”: ”NL48OPEN0098543109”,
“token”: “73737539836501732697”
}
}
40. www.openweb.nl
What we learned
▰ Three ways to build GraphQL into event sourcing
▰ Demo shows it’s viable, 300 new subscriptions/sec
▰ Demo has limited limited authentication and
authorization
▰ Scalability solvable but tricky