image of

Learning GraphQL

Declarative Data Fetching for Modern Web Apps

Eve Porcello & Alex Banks

Why is GraphQL the most innovative technology for fetching data since Ajax? By providing a query language for your APIs and a runtime for fulfilling queries with your data, GraphQL presents a clear alternative to REST and ad hoc web service architectures. With this practical guide, Alex Banks and Eve Porcello deliver a clear learning path for frontend web developers, backend engineers, and project and product managers looking to get started with GraphQL.

  1. Tell us a bit about yourself and why you want to learn GraphQL?
  2. What is GraphQL?
  3. What are some of the drawbacks of a REST API?
  4. What are the most used GraphQL clients?
  1. What is Graph Theory?
  2. How does Graph Theory — directed graph — can help you understand the tree data structure?
  3. How is the social network different in the Facebook and Twitter examples? Can you think of other examples of graph relation present in other web platforms?
  1. What are some of the differences between GraphQL and SQL?

  2. What are GraphQL query, mutation and subscription?

  3. How can you extract data from successful or unsuccessful queries?

  4. Which of these query features did you find the most interesting? What does it do?

    • Fragments
    • Union Types
    • Interfaces
    • Variables
  1. What is a GraphQL Schema? And what is a GraphQL Type?
  2. What connections are possible between different Types?
  3. When should you use Union Type vs Interface?
  4. How do arguments can be used to filter, paginate or sort data?

Sub-topics: Project Setup / Resolvers / apollo-server-express

  1. What is a Resolver? How do Resolvers and Types work together in the Schema?
  2. Why should you pass “parent” as an argument to a Root Resolver mutation?
  3. How connections are set in the photo sharing app example?
  4. How can you add a timestamp to posted Photos using Custom Scalars?
Pages: 83 — 104
Sub-topics: Context, GitHub Authorization, Conclusion
  1. What is Context?
  2. What should you store in the Context?
  3. How do you connect a GraphQL API to a MongoDB instance?
  4. What’s the me Query? How can you identify the user who is logged in?
Pages: 104 — 121
  1. What information do you need to send in an HTTP request from a Client to an API endpoint?
  2. How do you cache data with Apollo Client? How can you persist cache in the browser?
  3. What are the Apollo Client fetch policies?
  4. What would be a use case for using writeQuery to write to cache?