Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Real-time API's with GraphQL
Search
Sandeep Singh
October 14, 2018
Research
390
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Real-time API's with GraphQL
Sandeep Singh
October 14, 2018
Transcript
37 slides
Real-Time API’s with GraphQL Sandeep Singh initialspark.co.uk @initial_spark
◦ What is GraphQL ? ◦ Why it exists and
the problems it aims to solve ? ◦ GraphQL core concepts ◦ Real-Time API’s – the what, why and how Agenda @initial_spark
GraphQL is a declarative query language for your API @initial_spark
@initial_spark
◦Built on specification ◦Hierarchical ◦Client‐driven ◦Strongly typed What is GraphQL?
@initial_spark
Q: Why GraphQL? @initial_spark
◦Efficiency ◦Predictability ◦Versioning ◦Caching ◦Security, tooling, documentation and more Modern
API considerations @initial_spark
Let’s look at an example… @initial_spark
@initial_spark
Efficiency @initial_spark
Efficiency @initial_spark GraphQL API Mongo DB AWS Lamba REST API
SOAP Service HTTP TCP/IP HTTP SOAP Optimisted data for each channel
Versioning Evolution @initial_spark
Tooling & DX @initial_spark
Introspection { __schema{ types{ name } } } • Query
schema, types and fields • Build tools o Auto complete / Validate (graphiql) o Code generation o Documentation @initial_spark
GraphQL Core Concepts @initial_spark
Schema Type System Query Language GraphQL Core Concepts @initial_spark
GraphQL Core Concepts - Resolvers @initial_spark
Schema Type System Query Language o Operations • Queries –
read • Mutations – write • Subscriptions – real-time o Alias o Fragments GraphQL Core Concepts @initial_spark
Lets build a GraphQL API! @initial_spark
@initial_spark
◦ Unpredictable Execution ◦ Handling File Upload ◦ Cache at
Network Level ◦ Authentication/Authorisation GraphQL - Challenges @initial_spark
Q:What about Real-time data? @initial_spark
@initial_spark Chat Notifications Live feed Collaborative
◦ Pull ◦ Polling - Short/Long - HTTP ◦ Push
◦ Subscriptions - Event driven ◦ Live queries - Infinitely fast/cheap polling (State driven) Real-Time API’s @initial_spark
◦ Real time events ◦ Idea: Server pushes data to
client when something ‘interesting’ occurs ◦ The client defines the shape of the data pushed to it Subscriptions – Event Based @initial_spark
◦ The initial state is large, but the incremental change
sets are small ◦ You care about low-latency updates in the case of specific events, e.g. chat application where users expect to receive new messages in a matter of seconds Subscriptions – When to use @initial_spark
Subscriptions Implementation @initial_spark
Subscriptions (Redis, Kafka, MQ, own?) @initial_spark Request / Response Bi-Directional
Transport (SSE, websockets etc) HTTP Subscription(s) GraphQL Domain Events Events
@initial_spark
Let’s look at another example… @initial_spark
@initial_spark GraphQL API Run Mutation Trigger Subscription subscription {patientDischarged{…}} PAS
View (Admin) Ward View (Nurse)
Lets have some fun with subscriptions @initial_spark
Advanced features – Enrich payload @initial_spark
@initial_spark There isn’t such thing as a free lunch…
◦ Scaling state is hard ◦ Who’s subscribed/ how do
we send messages etc ◦ QOS ◦ Throttling ◦ Buffering Subscriptions - Challenges @initial_spark
◦ http://graphql.org/learn/ ◦ https://www.youtube.com/watch?v=bn8qsi8jVew - Lee Byron ◦ https://github.com/apollographql/apollo-client ◦
https://github.com/initialspark/real-time-apis-graphql ◦ https://www.graphqlhub.com/ ◦ https://www.youtube.com/watch?v=4_Bcw7BULC8 - Authentication Resources @initial_spark
Thank you ! You can find me at @initial_spark &
initialspark.co.uk
More Decks by Sandeep Singh
See All by Sandeep Singh
NDC OSLO 2017
initialspark
1
200
DDD 12 - Goodbye REST; Hello GraphQL
initialspark
0
1.3k
DDDSouthwest - JavascriptServices: Building Single Page Applications with ASP.NET Core
initialspark
0
98
NDC London 2017 - Bundling Your front end with webpack
initialspark
0
190
Other Decks in Research
See All in Research
山中市政が招いた組織崩壊:よこはま安心ボックスを例に
sishi
0
370
Byzantine Eventual Consistency for Reliable Local-First Software
ept
0
410
Pesée et pointage par imagerie 3D : PHENO3D entre en phase de test terrains
institutdelelevage
PRO
0
160
最先端NLP 2026 論文紹介: Wait, Wait, Wait... Why Do Reasoning Models Loop? / SNLP Paper Review: Wait, Wait, Wait... Why Do Reasoning Models Loop?
tkng
0
280
宛先から考えるデジタルアーカイブ:――ジャック・デリダの〈痕跡〉と三輪田米山日記
ktanishima
0
110
Méthane 2030 : Développer des solutions de réduction des émissions de méthane entérique : 1ers résultats
institutdelelevage
PRO
0
130
[最先端NLP勉強会2026] Checklists Are Better Than Reward Models For Aligning Language Models
nzw0301
1
350
Empreinte carbone des ovins : une approche globale (technique, économique, environnementale) – 4 années de résultats avec LIFE GREEN SHEEP
institutdelelevage
PRO
0
160
GeoAgent勉強会 論文紹介と強い推論モデルが与えるインパクト
satai
5
490
進化?迷走?CasualConc ファミリーアプリの現在地 @ 英語コーパス学会 2026
casualconc
0
160
完全自律LLMエージェントでDIVER OSINT CTF 2026に挑戦してみた
analokmaus
0
830
[UAI2026, Tutorial Talk] Tensor Networks for Density Estimation: The merits of low-rank structures, tractable inference, and uncertainty quantification
gkazunii
0
130
Featured
See All Featured
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
610
Large-scale JavaScript Application Architecture
addyosmani
516
110k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
530
The agentic SEO stack - context over prompts
schlessera
0
1k
Producing Creativity
orderedlist
PRO
348
41k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Product Roadmaps are Hard
iamctodd
55
13k
Balancing Empowerment & Direction
lara
6
1.4k
A designer walks into a library…
pauljervisheath
211
25k
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
How to Ace a Technical Interview
jacobian
280
24k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
340