12.6 · REST, GraphQL and gRPC, and building a client platform

The protocol choice is mostly a server decision with client consequences. The platform question is how a dozen features share one disciplined way of talking to the network.

Mental model. Choose the shape of the API by what clients need to fetch, and build one client layer that every feature goes through.

Styles and platform

API styles from the client side, and building a client for many apps.

  1. REST, GraphQL or gRPC: what are the client-side trade-offs? 12.6.1 · L5
    REST models resources at URLs and uses HTTP verbs and status codes. For a client it is simple, uses plain URLSession and Codable, benefits fully from HTTP…
  2. How would you design a networking layer shared by many apps and teams: interceptors, mocking, and URLProtocol? 12.6.2 · L8
    A shared client should be one small layer with a narrow public API and everything else configurable behind it. Start from a URLSession per configuration, owned…

More in Networking