Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Future of Rails

The Future of Rails

A talk about the future of Rails and the future of Rails developers, written for junior developers studying at RMIT.

Ryan Bigg

April 30, 2018
Tweet

More Decks by Ryan Bigg

Other Decks in Programming

Transcript

  1. A browser JS App Models Database Rails App REST +

    JSON API /api/posts /api/comments … Currently… JSON APIs
  2. GET /api/posts/1 { "id": 1, "title": "Hello World", "body": "This

    is my blog's first post." "author": "Ryan Bigg" } JSON APIs
  3. A browser JS App Models Database Rails App REST +

    JSON API /api/posts /api/comments … Currently… JSON APIs Need to build lots of these…
  4. A browser JS App Models Database Rails App /graphql Now…

    GRAPHQL Only one endpoint (born 2012)
  5. 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
  6. 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
  7. POST /graphql query commentQuery { comment(id: 1) { text user

    } } { "data": { “comment”: { text: "Great first post!", user: "Totally not Ryan” } } } Query Response GRAPHQL
  8. 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
  9. ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… ………………………………………………………………………………………………………………

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