Supercharge your schemas with custom directives
summary
Shows how to implement runtime behavior with Apollo SchemaDirectiveVisitor, registers directives via makeExecutableSchema, and wires custom resolvers that override or replace field results. Gives a concrete replace directive example, an async rest directive that fetches external APIs, and a hasScope directive for token-based authorization that stacks with others. Demonstrates where to hook into field and object nodes, caveats about schema-first vs code-first, and a working tutorial site trygql.com.
AI-written summary · about
chapters (9)
- 0:00Start
- 1:06What Is a Schema Directive
- 1:37Advice on Directives
- 2:25Schema Directives
- 4:10Authentication
- 4:26String Formatting
- 9:47Rest Directive
- 12:02Custom Schema Directives
- 13:48Middleware
related talks
35mGraphQL Docs: Beyond the Schema
01h 28mWorkshop: Demand-Driven Schema Design
29mClosing the Loop: How GraphQL Gives Coding Agents Eyes on What Actually Matters
31mGraphQL ecosystem walkthrough
31mAccelerating GraphQL API Development with Schema Storming and Code-first Implementation
26mDeep Dive Into GraphQL Grammar and Syntax
30mGraphQL is no excuse to stop writing docs
49mGraphQL Schema Design — Building Schemas Correctly (version 2)
