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

Understanding Apollo GraphQL

Understanding Apollo GraphQL

Presentation slides for GoDaddy Seminar in San Francisco, Jun 5th 2018.

Jacopo Daeli

June 05, 2018
Tweet

More Decks by Jacopo Daeli

Other Decks in Technology

Transcript

  1. What is GraphQL? GraphQL is a query language for APIs

    and a runtime for fulfilling those queries with your existing data. It gives clients the power to ask for exactly what they need and nothing more. This makes things easier to evolve APIs over time, and enables powerful developer tools.
  2. What is GraphQL? GraphQL queries always return predictable results. Apps

    using GraphQL are fast and stable because they control the data they get, not the server.
  3. What is GraphQL? While typical REST APIs require loading from

    multiple URLs, GraphQL APIs returns all the data your app needs in a single request.
  4. What is GraphQL? GraphQL APIs are organized in terms of

    types and fields, not endpoints. It uses types to ensure Apps only ask for what’s possible and provide clear and helpful errors.
  5. What is Apollo GraphQL? Apollo is a family of technologies

    you can incrementally add to your stack: - Apollo Client to connect data to your UI - Apollo Engine for infrastructure and tooling - Apollo Server to translate your REST API and backends into a GraphQL schema Apollo team is the same team behind Meteor.js.
  6. Apollo Client Apollo Client is a community-driven multi-platform GraphQL client.

    It allows developers to bind GraphQL data to the UI with one single function call. Apollo Client works with every frontend platform: React, Vue.js, Angular, iOS, etc.
  7. Apollo Client Apollo Clients comes with very cool pre-bundled features

    such as: - Declarative data fetching: all of the logic for retrieving your data, tracking loading and error states, and updating your UI is encapsulated in a single Query component. - Zero-config caching: cache out of the box with no additional configuration required. - Combine local & remote data: use apollo-link-state add client-side only fields to your remote data seamlessly and use Apollo cache as the single source of truth for data in your application. - GraphQL subscriptions support: push data from the server to the clients that choose to listen to real time messages from the server.
  8. Apollo Server Apollo Server implements a spec-compliant GraphQL server which

    can be queried from any GraphQL client, including Apollo Client. Apollo Server Apollo Server implements a spec-compliant GraphQL server which can be queried from any GraphQL client, including Apollo Client.
  9. Apollo Server (v2) Apollo Server 2 is specifically designed for

    standing up a GraphQL server in front of whatever you already have today. It is 100% open-source JavaScript. Today it is in beta and recommended for production use.
  10. Apollo Server (v2) - It hosts GraphQL Playground, an IDE

    that allows you to inspect your schema and run queries. - It has standard patterns out of the box, and everything is wired up for you: error handling, caching (including whole query caching, partial query caching), etc. - Apollo Server 2 supports subscriptions out of the box. - It is shipped with an opt-in Apollo Engine integration. - Interesting reading at dev-blog.apollodata.com/apollo-server-2-0-30c9bbb4ab5e
  11. REST Datasource REST Datasource can automatically cache responses based on

    HTTP headers. It can be used with Redis, Memcache, etc. It automatically handles batching for a single request lifecycle and perfectly integrates with the concept of whole/partial query caching.
  12. Apollo Serverless Serverless is totally a good fit for GraphQL.

    Apollo team has been working with Cloudflare to build GraphQL inside a Cloudflare edge worker. Hence you can use Apollo Server at the edge. Cloudflare has something like 151 pops around the world. However, this isn't quite ready for production. More details apollographql.com/edge.
  13. Apollo Engine Apollo Engine is a GraphQL gateway that helps

    you implement and run GraphQL over REST or any other backend with confidence.
  14. Apollo Engine Apollo Engine tracks how each client uses the

    backend services. It compares queries from active clients against the proposed schema. It understands the impact of the change you're going to make even against the third-parties that are using your API. It can give you a field-by-field view of how expensive each thing is.
  15. Apollo Engine Apollo Engine principal features: - Editors and DevTools

    - Alerts and monitoring - Metrics and APM (Application perf management) - Logging and errors