Slide 1

Slide 1 text

GraphQL TUGBERK UGURLU

Slide 2

Slide 2 text

https://flic.kr/p/7ZJ5Aa

Slide 3

Slide 3 text

GraphQL is a query language for your API, and a server-side runtime for executing queries by using a type system you define for your data. (http://graphql.org/learn/)

Slide 4

Slide 4 text

WHAT PROBLEMS DOES IT ADDRESS? Strongly Typed Describe what’s possible with a type system Declarative Ask for what you need, get exactly that Compositional Get many resources in a single request

Slide 5

Slide 5 text

WHO’S USING GRAPHQL? http://graphql.org/users/

Slide 6

Slide 6 text

CHARACTERISTICS Query has exactly the same shape as the result GraphQL operates on set of types in your schema

Slide 7

Slide 7 text

CHARACTERISTICS GraphQL services can be written in any language Introspection system allows you to ask for information about the schema

Slide 8

Slide 8 text

SHOW ME THE CODE! https://flic.kr/p/ec78kF

Slide 9

Slide 9 text

HELLO WORLD!

Slide 10

Slide 10 text

HELLO WORLD!

Slide 11

Slide 11 text

NULLABILITY http://graphql.org/learn/best-practices/#nullability

Slide 12

Slide 12 text

HELLO WORLD!

Slide 13

Slide 13 text

SERVER

Slide 14

Slide 14 text

CLIENT

Slide 15

Slide 15 text

GITHUB GRAPHQL API V4 https://developer.github.com/v4/

Slide 16

Slide 16 text

GITHUB GRAPHQL API V4

Slide 17

Slide 17 text

GITHUB GRAPHQL API V4

Slide 18

Slide 18 text

GITHUB GRAPHQL API V4

Slide 19

Slide 19 text

GRAPHIQL https://github.com/graphql/graphiql

Slide 20

Slide 20 text

SILVER BULLET? https://flic.kr/p/5UBU5r

Slide 21

Slide 21 text

A FEW PROBLEMS Authentication and Authorization You are on your own! HTTP Caching Cause by having a POST request with single endpoint Unpredictable Execution Freedom has its cost!

Slide 22

Slide 22 text

MUTATIONS It seems immature and enforces the RPC pattern. (http://graphql.org/learn/queries/#mutations)

Slide 23

Slide 23 text

BFF (BACKENDS FOR FRONTENDS) (http://samnewman.io/patterns/architectural/bff/)

Slide 24

Slide 24 text

ODATA? https://twitter.com/tourismgeek/status/904983421352644608

Slide 25

Slide 25 text

FURTHER RESOURCES https://flic.kr/p/4omoir

Slide 26

Slide 26 text

RFC SPEC http://facebook.github.io/graphql/ (Working draft, last updated IN 2016, Oct)

Slide 27

Slide 27 text

THINKING IN GRAPHS http://graphql.org/learn/thinking-in-graphs/

Slide 28

Slide 28 text

RELAY https://facebook.github.io/relay/

Slide 29

Slide 29 text

MORE LINKS • Home of GraphQL: http://graphql.org/ • Best Practices with GraphQL: http://graphql.org/learn/best-practices/ • Getting Started: http://graphql.org/graphql-js/ • Validation: http://graphql.org/learn/validation/ • Pagination: http://graphql.org/learn/pagination/