PyCon UK 2023

Optimizing GraphQL Performance: Tips and Techniques
09-24, 11:00–11:30 (Europe/London), Assembly Room

In this talk, we'll explore techniques to optimize GraphQL performance for snappy, scalable, and resource-efficient APIs. Attendees will learn about batching queries with DataLoader, managing query complexity and depth, leveraging persisted queries for reduced network overhead, and implementing
caching strategies on both server and client-side.


API performance is crucial for delivering a smooth and responsive user
experience. GraphQL has gained popularity as a flexible and efficient query
language, but without proper optimization, it may underperform or even become a
bottleneck in your application.

In this talk, we'll dive into the essential techniques and best practices to
optimize GraphQL performance, ensuring that your APIs are snappy, scalable, and
resource-efficient. Attendees will learn:

  • The importance of batching queries and how to implement it using DataLoader or
    similar libraries.
  • The concept of query complexity and depth, and how to set up limits to prevent
    resource abuse.
  • Leveraging persisted queries to reduce network overhead and improve caching
    capabilities.
  • Implementing caching strategies, both on the server and client-side, to
    minimize redundant requests and reduce load times.
  • Exploring monitoring and observability tools that can help you identify
    performance bottlenecks and continuously optimize your GraphQL implementation
    for maximum efficiency.

Patrick is a Developer Advocate at Apollo GraphQL. He created Strawberry, a python library that makes it easy to create GraphQL APIs using type hints