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
Deep Dive into Kotlin Flow
jmatsu
1
360
Rancher と Terraform
fufuhu
2
550
旅行プランAIエージェント開発の裏側
ippo012
2
920
Design Foundational Data Engineering Observability
sucitw
3
200
はじめてのMaterial3 Expressive
ym223
2
860
Compose Multiplatform × AI で作る、次世代アプリ開発支援ツールの設計と実装
thagikura
0
160
Processing Gem ベースの、2D レトロゲームエンジンの開発
tokujiros
2
130
How Android Uses Data Structures Behind The Scenes
l2hyunwoo
0
470
複雑なフォームに立ち向かう Next.js の技術選定
macchiitaka
2
180
Navigation 2 を 3 に移行する(予定)ためにやったこと
yokomii
0
320
Azure SRE Agentで運用は楽になるのか?
kkamegawa
0
2.4k
250830 IaCの選定~AWS SAMのLambdaをECSに乗り換えたときの備忘録~
east_takumi
0
400
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
31
2.2k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
A designer walks into a library…
pauljervisheath
207
24k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
The Pragmatic Product Professional
lauravandoore
36
6.9k
Building Adaptive Systems
keathley
43
2.7k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
113
20k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
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