Slide 1

Slide 1 text

Mentor / Author / Developer

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

PART ONE

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

ISN’T RAILS THE FUTURE OF RAILS AS YOU KNOW IT TODAY

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

A browser Database Backend App Models Rails App In the past…

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

A browser JS App Database Frontend App Backend App Models Rails App Now…

Slide 12

Slide 12 text

COMMUNICATION A browser JS App Models Database Rails App ???

Slide 13

Slide 13 text

A browser JS App Models Database Rails App REST + JSON API /api/posts /api/comments … Currently… JSON APIs

Slide 14

Slide 14 text

GET /api/posts/1 { "id": 1, "title": "Hello World", "body": "This is my blog's first post." "author": "Ryan Bigg" } JSON APIs

Slide 15

Slide 15 text

GET /api/posts/1/comments [ { text: "Great first post!", by: "Totally not Ryan" }, ... ] JSON APIs

Slide 16

Slide 16 text

A browser JS App Models Database Rails App REST + JSON API /api/posts /api/comments … Currently… JSON APIs Need to build lots of these…

Slide 17

Slide 17 text

EVERYONE DOES THIS

Slide 18

Slide 18 text

EVEN FACEBOOK

Slide 19

Slide 19 text

Well… they did

Slide 20

Slide 20 text

A browser JS App Models Database Rails App /graphql Now… GRAPHQL Only one endpoint (born 2012)

Slide 21

Slide 21 text

POST /graphql query postQuery { post(id: 1) { id title body author comments { text by } } } { "data": { "post": { "id": 1, "title": "Hello World", "body": "First post!”, "author": "Ryan Bigg", "comments": [ { text: "Great first post!", by: "Totally not Ryan" }, ... ] } } } Query Response GRAPHQL

Slide 22

Slide 22 text

POST /graphql query postQuery { post(id: 1) { id title body author comments { text by } } } { "data": { "post": { "id": 1, "title": "Hello World", "author": "Ryan Bigg", "comments": [ { text: "Great first post!", by: "Totally not Ryan" }, ... ] } } } Query Response GRAPHQL

Slide 23

Slide 23 text

POST /graphql query commentQuery { comment(id: 1) { text user } } { "data": { “comment”: { text: "Great first post!", user: "Totally not Ryan” } } } Query Response GRAPHQL

Slide 24

Slide 24 text

GRAPHQL IS THE FUTURE

Slide 25

Slide 25 text

GRAPHQL IS THE FUTURE (or at least, it seems like it)

Slide 26

Slide 26 text

THE FUTURE OF RAILS Frontend + Backend apps talking over GraphQL

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

END PART ONE

Slide 29

Slide 29 text

PART TWO

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

RAILS IS ALWAYS CHANGING

Slide 32

Slide 32 text

Then… Now…

Slide 33

Slide 33 text

THE NEW SHINY IS ALWAYS CHANGING

Slide 34

Slide 34 text

JSON GRAPHQL APIs APIs

Slide 35

Slide 35 text

RAILS IS JUST A TOOL

Slide 36

Slide 36 text

APIs ARE A CONCEPT

Slide 37

Slide 37 text

THERE ARE INFINITY THINGS TO LEARN

Slide 38

Slide 38 text

FOCUS ON CONCEPTS
 NOT TOOLS

Slide 39

Slide 39 text

{ name: “Ryan”, age: 30 } %{ name: “Ryan”, age: 30 } Ruby Elixir

Slide 40

Slide 40 text

h = { name: “Ryan” } if h.has_key?(:name) puts “Name: #{h[:name]}” else puts “name is not present” end Ruby Elixir fn %{name: name} -> IO.puts(“name: #{name}”) _ -> IO.puts(“name is not present”) end

Slide 41

Slide 41 text

CONCEPTS
 SPAN TOOLS

Slide 42

Slide 42 text

What is a funcFon?

Slide 43

Slide 43 text

How do pages load?

Slide 44

Slide 44 text

/graphql is returning an HTTP 500 status code Why?

Slide 45

Slide 45 text

The app stopped responding.

Slide 46

Slide 46 text

CPU usage is high. Can you find out why?

Slide 47

Slide 47 text

What is “clean code”?

Slide 48

Slide 48 text

Is this “clean code”?

Slide 49

Slide 49 text

What do other developers consider “best pracFce”?

Slide 50

Slide 50 text

Follow the code.

Slide 51

Slide 51 text

……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… Test the code.

Slide 52

Slide 52 text

END PART TWO

Slide 53

Slide 53 text

✉: me@ryanbigg.com Thanks! : @ryanbigg ▶: h?p:/ /bit.ly/radar-for

Slide 54

Slide 54 text

h?ps:/ /developer.github.com/v3/ API Examples REST + JSON h?ps:/ /developer.github.com/v4/ GRAPHQL

Slide 55

Slide 55 text

h?ps:/ /www.howtographql.com/ Learn these: GraphQL h?ps:/ /reactjs.org/tutorial/tutorial.html React

Slide 56

Slide 56 text

h?ps:/ /www.sandimetz.com/99bo?les/ Read these: 99 BOTTLES h?ps:/ /www.poodr.com PRACTICAL OBJECT-ORIENTED DESIGN IN RUBY

Slide 57

Slide 57 text

h?ps:/ /joyofelixir.com Learn Elixir from scratch!

Slide 58

Slide 58 text

h?ps:/ /speakerdeck.com/radar/exploding-rails h?ps:/ /leanpub.com/exploding-rails Exploding Rails h?ps:/ /github.com/radar/twist-v2 MY EXAMPLE APPLICATION