Getting Started with GraphQL

Da526e4b5901b3a2759cf234285c6488?s=47 Jennifer Bland
October 20, 2018
20

Getting Started with GraphQL

GraphQL is a new API standard that provides a more efficient, powerful and flexible alternative to REST. At its core, GraphQL enables declarative data fetching where a client can specify exactly what data it needs from an API. Instead of multiple endpoints that return fixed data structures, a GraphQL server only exposes a single endpoint and responds with precisely the data a client asked for. In this talk, I will give you an introduction to GraphQL and then show you how to use it to access Github’s GraphQL API.

Da526e4b5901b3a2759cf234285c6488?s=128

Jennifer Bland

October 20, 2018
Tweet

Transcript

  1. 2.

    Three Truths and One Lie •I have visited 82 countries

    •I graduated from college before IBM introduced the IBM PC •My home is 400 sq ft •I have never been west of the Mississippi River
  2. 11.
  3. 12.
  4. 14.
  5. 16.
  6. 17.
  7. 18.
  8. 20.
  9. 21.
  10. 22.

    22 // GET ‘/graphql { projects {
 title image }

    } // result { projects {
 title: “Build a Fire Pit image: “firepit.png” } }
  11. 23.

    23

  12. 24.

    24

  13. 25.

    25

  14. 26.
  15. 27.
  16. 29.

    Queries 29 query { relatedProjects { # this is an

    array title image details { description tools category }
  17. 32.
  18. 34.

    Resolvers 34 Post: { author(post) { return Users.find({ id: post.authorId})

    }, commentsCount(post) { return Comments.find({ postId: post.id}).count() } }
  19. 35.
  20. 37.

    Three Truths and One Lie •I have visited 82 countries

    •I graduated from college before IBM introduced the IBM PC •My home is 400 sq ft •I have never been west of the Mississippi River