Slide 1

Slide 1 text

UNDERSTANDING APOLLO GRAPHQL Jacopo Daeli Lead Software Engineer @ GoDaddy San Francisco, Jun 5th 2018 GoDaddy Seminar

Slide 2

Slide 2 text

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.

Slide 3

Slide 3 text

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.

Slide 4

Slide 4 text

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.

Slide 5

Slide 5 text

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.

Slide 6

Slide 6 text

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.

Slide 7

Slide 7 text

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.

Slide 8

Slide 8 text

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.

Slide 9

Slide 9 text

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.

Slide 10

Slide 10 text

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.

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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.

Slide 13

Slide 13 text

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.

Slide 14

Slide 14 text

Apollo Engine Apollo Engine is a GraphQL gateway that helps you implement and run GraphQL over REST or any other backend with confidence.

Slide 15

Slide 15 text

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.

Slide 16

Slide 16 text

Apollo Engine Apollo Engine principal features: - Editors and DevTools - Alerts and monitoring - Metrics and APM (Application perf management) - Logging and errors

Slide 17

Slide 17 text

It’s demo time !"