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

GraphQL

 GraphQL

Internal Lightning Talk @ Redgate, Cambridge, UK

Tugberk Ugurlu

September 05, 2017
Tweet

More Decks by Tugberk Ugurlu

Other Decks in Programming

Transcript

  1. GraphQL
    TUGBERK UGURLU

    View full-size slide

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

    View full-size slide

  3. 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/)

    View full-size slide

  4. 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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  9. HELLO WORLD!

    View full-size slide

  10. HELLO WORLD!

    View full-size slide

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

    View full-size slide

  12. HELLO WORLD!

    View full-size slide

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

    View full-size slide

  14. GITHUB GRAPHQL API V4

    View full-size slide

  15. GITHUB GRAPHQL API V4

    View full-size slide

  16. GITHUB GRAPHQL API V4

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  19. 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!

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  27. 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/

    View full-size slide