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

All You Ever Wanted To Know About GraphQL - JAM...

All You Ever Wanted To Know About GraphQL - JAMstack Meetup Presentation

Founders of TakeShape, Andrew Sprouse and Mark Catalano, discuss GraphQL and how they use it to build TakeShape (https://www.takeshape.io/).

Avatar for Mark Catalano

Mark Catalano

June 18, 2019

Other Decks in Technology

Transcript

  1. What We’re Going To Cover • What is GraphQL •

    Anatomy of a GraphQL environment • Demo • Why does GraphQL make sense for JAMStack? • Questions
  2. Schema • Provides a strongly typed description of your data

    • Schema Description Language (SDL) is the recommended cross-platform way to specify schema.
  3. Resolution Framework • Each GraphQL implementation provides it own query

    resolution framework • GraphQL.js is the reference implementation
  4. Resolvers • Perform query and mutation resolution • GraphQL.js is

    the reference implementation Resolvers Schema (SDL)
  5. 2. Flexibility • Write the GraphQL Schema once use everywhere

    • Stop writing/querying many custom REST endpoints for each application customizing queries can be done on the frontend.
  6. - Cons • GraphQL was relatively new and not yet

    widely adopted. • Facebook Patent Restrictions • Everyone knows REST • Wrestling REST endpoints to mash up custom data. • REST APIs are opaque and can be hard to learn + Pros
  7. query { homepage { title image { path } }

    <html> <head> <title>{{ homepage.title }}</title> </head> <body> <h1>{{ homepage.title }}</h1> <img src="{{ homepage.image.path | image }}"/> </body> </html> GraphQL Template
  8. Using TakeShape’s GraphQL API GraphQL Query files + TakeShape SSG

    TakeShape’s GraphQL API Third Parties That Like to Party with GraphQL