graphql the new black?

47
Fernand Galiana GraphQL New Black?

Upload: fernand-galiana

Post on 14-Apr-2017

183 views

Category:

Technology


0 download

TRANSCRIPT

Fernand Galiana

GraphQL New Black?

imhotep.io @kitesurfer

CS 11

imhotep.io @kitesurfer

imhotep.io @kitesurfer

• RPC

• CORBA

• SOAP

• Beans

• JSONSchemas

• OData

• JSONAPI

• …

imhotep.io @kitesurfer

• REST

• Hypermedia

• Apiary

• Swagger

• …

imhotep.io @kitesurfer

grap

hQL

imhotep.io @kitesurfer

{ events { name year }

}

{ “events” { “name”: “Australian Open” “year” : 2017 }

}

imhotep.io @kitesurfer

• Thin Spec

• Consumer driven

• Self Docs

• What - !How

• Data Safety

• Incremental Adoption

• Transport Agnostic

• OnBoarding

• *REST Calls

• Over/Under fetch

imhotep.io @kitesurfer

big

deal

?

imhotep.io @kitesurfer

• Rich Clients

• Mo’ Data

• Savvier users

• Microservices

• Best of Bride Langs / Stores / Fmk

• Multi Devices / API Clients

• Mobile / Network Bandwidth

• Type all teh things!

imhotep.io @kitesurfer

2005

imhotep.io @kitesurfer

2017

2014

/api

2017

/graphql

imhotep.io @kitesurfer

imhotep.io @kitesurfer

arch

itectures

imhotep.io @kitesurfer

GraphQL

imhotep.io @kitesurfer

GraphQL

Svc1 Svc2 Svc3 Svc4

imhotep.io @kitesurfer

clos

er lo

ok

imhotep.io @kitesurfer

Query Mutation

oper

atio

ns

imhotep.io @kitesurfer

type

s

imhotep.io @kitesurfer

• String (!|[])

• ID

• Float

• Int

• Boolean

• Custom (Date)

• Enum

• Interface

• Unions (concrete types only!)

imhotep.io @kitesurfer

your

mis

sion

imhotep.io @kitesurfer

imhotep.io @kitesurfer

Rod Laver 6,4,6,3,6,2

ESP 32

SWI 35

Finals

Match

Rafael Nadal

Roger Federer

Aussie Open 2017 Draw

imhotep.io @kitesurfer

Rod Laver 6,4,6,3,6,2Finals

Match

ESP 32

Rafael Nadal

SWI 35

Aussie Open 2017 Draw

Quarter

Draw

Semis

DrawRoger Federer

imhotep.io @kitesurfer

Rod Laver 6,4,6,3,6,2

Quarter

Finals

Semis

Match

ESP 32

Rafael Nadal

SWI 35

Aussie Open 2017 Draw

Draw

DrawRoger Federer

imhotep.io @kitesurfer

Demo Sourcegithub.com/derailed/ao-demo

imhotep.io @kitesurfer

in a

ctio

n

EchoSystems

imhotep.io @kitesurfer

auth

[9,1

0]

imhotep.io @kitesurfer

Subscriptions

Herpes Test Results

imhotep.io @kitesurfer

cach

ing

imhotep.io @kitesurfer

batc

hing

imhotep.io @kitesurfer

• Throttle query calls for duration

• client side resolver (Relay)

imhotep.io @kitesurfer

pagi

natio

n

imhotep.io @kitesurfer

framew

orks

Relay

imhotep.io @kitesurfer

take

aw

ays

imhotep.io @kitesurfer

• Think graph!

• Baby steps

• Design for the future

• Name/Doc wisely

• Premature caching

• Forget polymorphism!

• Fragments reuse

• Track mutations

• Balance #calls vs payload

• QL Mocks

• Countermeasures for DDOS

• Client side still JSON - !Models

• Client/Server teams

• No breaking changes?

• Query tuning

• Null / Errors

• Relational Stores??

• Bigs schemas

• Monitoring /graphql?

imhotep.io @kitesurfer

refe

renc

es

imhotep.io @kitesurfer

• github.com/derailed/ao-demo

• graphql.org

• github.com/facebook/dataloader

• absinthe-graphql.org

• github.com/apollostack

• facebook.github.io/relay

• github.com/chentsulin/awesome-graphql

Thank you!

Photos provided by blackandwtf.tumblr.com