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

Query data like a pro - an introduction to GraphQL

Eric
October 27, 2016

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

Other Decks in Programming

Transcript

  1. 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
  2. CONTENTS REST in peace? GraphQL to the rescue Connecting React

    What about the server? The new shit! 4 / 19
  3. REST IN PEACE? http://api.com/user/1 { "user": { "id": "1", "name":

    "Eric", "email": "[email protected]", "friends": [ "/user/20/", "/user/30/" ] } } 5 / 19
  4. GRAPHQL TO THE RESCUE query { user { id name

    email friends { name } } } 6 / 19
  5. QUERY PARAMETERS QUERY VARIABLES query { user(id: 1) { name

    } } query User($userId: ID!) { user(id: $userId) { name } } { "userId": 1 } 7 / 19
  6. DIRECTIVES query User($userId: ID!, $friends: Boolean!) { user(userID: $userId) {

    name email friends @include(if: $friends) { name } } } 8 / 19
  7. FRAGMENTS { leftComparison: user(department: BILLING) { ...comparisonFields } rightComparison: user(department:

    IT) { ...comparisonFields } } fragment comparisonFields on Person { name friends { name } } 10 / 19
  8. 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