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

The rise of GraphQL

The rise of GraphQL

Since its introduction in 2015, GraphQL has become a very popular API. Often times replacing existing REST APIs as well. In this talk we’ll look at:

What GraphQL is
Why you should (not) use GraphQL
Some best practices for implementing a GraphQL spec
Potential downsides

Jelmer Snoeck

January 28, 2020
Tweet

More Decks by Jelmer Snoeck

Other Decks in Technology

Transcript

  1. The rise of GraphQL

    View full-size slide

  2. FIND ME
    github.com/jelmersnoeck
    twitter.com/jelmersnoeck
    Jelmer Snoeck
    ABOUT ME
    - Tech Lead at manifold.co
    - Gopher
    - Performance, reliability
    and scalability

    View full-size slide

  3. What is GraphQL?

    View full-size slide

  4. Quick history lesson
    - Created by Facebook in 2012
    - Open Sourced in 2015
    - GraphQL Foundation in 2018

    View full-size slide

  5. GraphQL is a query language for APIs and a runtime
    for fulfilling those queries with your existing data.
    GraphQL provides a complete and understandable
    description of the data in your API, gives clients the
    power to ask for exactly what they need and nothing
    more, makes it easier to evolve APIs over time, and
    enables powerful developer tools.
    - graphql.org

    View full-size slide

  6. Query Language

    View full-size slide

  7. evelinag.com

    View full-size slide

  8. graphql.org/swapi-graphql

    View full-size slide

  9. “a runtime for fulfilling those queries”

    View full-size slide

  10. Why (not) use GraphQL?

    View full-size slide

  11. Query Language + Runtime

    View full-size slide

  12. Ask for what you need

    View full-size slide

  13. /v1/people/cGVvcGxlOjE=?field_mask=name,gender

    View full-size slide

  14. Versioning and deprecation

    View full-size slide

  15. Error Handling

    View full-size slide

  16. Performance
    - Use dataloaders
    - Use GET requests (where possible)
    - Set complexity limits

    View full-size slide

  17. Best Practices

    View full-size slide

  18. Pagination
    - cursor based
    - pageInfo
    - pagination by default

    View full-size slide

  19. Global Object Identification

    View full-size slide

  20. Input/output objects for mutations

    View full-size slide

  21. Thanks! @jelmersnoeck
    manifold.co

    View full-size slide