Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Query data like a pro - an introduction to GraphQL
Search
Eric
October 27, 2016
Programming
0
63
Query data like a pro - an introduction to GraphQL
An introduction talk about GraphQL given at the React Kiel Meetup Germany.
Eric
October 27, 2016
Tweet
Share
Other Decks in Programming
See All in Programming
プールにゆこう
irof
2
120
Changed Rules: Architectures with Lightweight Stores
manfredsteyer
PRO
0
230
Rails と人魚の話/rails-and-mermaid
sanfrecce_osaka
0
100
二郎系ラーメンのコールで学ぶ AST 解析
memory1994
PRO
7
1.6k
Folding Cheat Sheet #3
philipschwarz
PRO
0
110
Front-end application development, Symfony-style(s)
dunglas
2
1.9k
#phpcon_odawara オープン・クローズドなテストフィクスチャを求めて / open closed test fixtures
77web
3
210
本格ローグライク制作にEbitengineを選んでみた
nagainaganawa
0
290
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
110
StreamlitとTerraformでデータカタログを作った話
gussan0223
0
300
1BRC--Nerd Sniping the Java Community
gunnarmorling
0
300
DMMプラットフォームがTiDB Cloudを採用した背景
pospome
8
3.5k
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
119
38k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
18
1.7k
Pencils Down: Stop Designing & Start Developing
hursman
117
11k
Fantastic passwords and where to find them - at NoRuKo
philnash
36
2.5k
Agile that works and the tools we love
rasmusluckow
324
20k
Building Applications with DynamoDB
mza
88
5.6k
Being A Developer After 40
akosma
56
580k
Designing for Performance
lara
602
67k
Rebuilding a faster, lazier Slack
samanthasiow
72
8.2k
Building a Scalable Design System with Sketch
lauravandoore
455
32k
How GitHub (no longer) Works
holman
304
140k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
186
16k
Transcript
QUERY DATA LIKE A PRO! AN INTRODUCTION TO GRAPHQL PRESENTED
BY ERIC STUMPER 1 / 19
DISCLAIMER 2 / 19
ABOUT ME Developing Software at weluse GmbH for amazing 2.5
months Worked as a Frontend Developer and IT/Networking guy before Started out with React, Elixir/Phoenix and GraphQL in my Master's Thesis Besides coding I love travelling, hiking, indoor and beach volleyball Twitter: @ericstumper 3 / 19
CONTENTS REST in peace? GraphQL to the rescue Connecting React
What about the server? The new shit! 4 / 19
REST IN PEACE? http://api.com/user/1 { "user": { "id": "1", "name":
"Eric", "email": "
[email protected]
", "friends": [ "/user/20/", "/user/30/" ] } } 5 / 19
GRAPHQL TO THE RESCUE query { user { id name
email friends { name } } } 6 / 19
QUERY PARAMETERS QUERY VARIABLES query { user(id: 1) { name
} } query User($userId: ID!) { user(id: $userId) { name } } { "userId": 1 } 7 / 19
DIRECTIVES query User($userId: ID!, $friends: Boolean!) { user(userID: $userId) {
name email friends @include(if: $friends) { name } } } 8 / 19
MUTATIONS mutation CreateUser($name: String!) { createUser(name: $name) { id }
} { "name": "Peter" } 9 / 19
FRAGMENTS { leftComparison: user(department: BILLING) { ...comparisonFields } rightComparison: user(department:
IT) { ...comparisonFields } } fragment comparisonFields on Person { name friends { name } } 10 / 19
CONNECTING REACT 11 / 19
WHAT ABOUT THE SERVER? 12 / 19
A SCHEMA AND TYPES IN ABSINTHE (ELIXIR) 13 / 19
THE NEW SHIT! 14 / 19
@DEFER query User($userId: ID!) { user(userID: $userId) { name email
friends @defer { name } } } 15 / 19
@STREAM query Users { users @stream { name email friends
@defer { name } } } 16 / 19
@LIVE query Users { users { name email friends @live
{ name } } } 17 / 19
SUBSCRIPTIONS subscription Users { users { name email } }
18 / 19
LINKS GENERAL SERVER CLIENT http://graphql.org/learn/ https://learngraphql.com/ https://wehavefaces.net/graphql-shorthand-notation-cheatsheet- 17cd715861b6#.c3z77kes8 Node: https://github.com/graphql/express-graphql
Node: http://dev.apollodata.com/tools/ Elixir: http://absinthe-graphql.org http://dev.apollodata.com/react/ https://facebook.github.io/relay/ https://github.com/kadirahq/lokka 19 / 19