Performant APIs with GraphQL and PHP
summary
Shows how a PHP server serves a single /graphql endpoint using webonyx/graphql-php to parse, validate and execute queries; builds a demo API (tutorial on GitHub/Glitch) that returns exactly the requested JSON shape and supports typed schemas. Addresses the n+1 problem with deferred resolvers and batching, recommends client libraries like Apollo or Lokka, explains persisted queries, tooling (Playground, Voyager, codegen) and limits (complexity/depth, no PHP subscriptions).
AI-written summary · about
chapters (22)
- 0:00Performant APIs with GraphQL and PHP
- 1:02Challenges with Traditional APIs
- 3:49Topics
- 5:04GraphQL Implementations
- 5:40GraphQL Advantages
- 6:20GraphQL in a web stack
- 8:50Arguments
- 9:07Variables
- 10:52Queries
- 12:16Lokka a simple graphal client library
- 12:48Apollo
- 14:05webonyx/graphql-php
- 15:56Root fields
- 18:25Custom object type
- 19:11And now we have a GraphQL server!
- 22:53Voyager - Any GraphQL API as an interactive graph
- 23:57PHPStorm JS GraphQL Plugin - IDE Integration
- 24:24Types can be used in client-side code
- 27:36Solution: deferred resolvers
- 28:50Limiting Query Complexity and Depth
- 33:26Challenges when using GraphQL
- 36:31Resources
related talks
50mGraphQL is right in front of us, let's do it, with Symfony
43mGraphQL API or He Who Asks Won't Err
10mIntroduction to PHP port of GraphQL
53mGraphQL: Improvements You Can Make Today
36mBuilding a GraphQL API with Laravel
55mGraphQL - APIs the New Way
31mGraphQL: how to make clients enjoy using your API
48mBuilding secure GraphQL APIs without the Boilerplate
