graphql recipes
4 tested graphql integration recipes with @apollo/server, dataloader, graphql-yoga, graphql-request. Exact pinned versions and a last-passed receipt, last run 2026-10-15.
Apollo Server 5 resolvers with per-request DataLoader batching
An Apollo Server 5 schema whose nested resolvers use per-request DataLoader instances to batch and dedupe lookups (no N+1), with GraphQLError extension codes and cache invalidation after a mutation, tested in-process with executeOperation.
GraphQL Yoga 5 schema, context and errors tested via fetch
Build a GraphQL Yoga server with SDL resolvers, per-request context auth and GraphQLError codes, tested in-process with yoga.fetch.
graphql-request client with typed operations, mocked by MSW graphql handlers
Call a GraphQL API with graphql-request (variables, headers, error handling) and test offline with MSW's graphql.link(url).query/mutation handlers (msw 3 API). graphql stays on 16.x: graphql-request 7 peers on graphql 14 - 16.
Pothos GraphQL schema served by GraphQL Yoga
Build a typed GraphQL schema with Pothos (queries and mutations over an in-memory store) and execute it offline through GraphQL Yoga's fetch handler.
Used together with graphql
@apollo/serverdataloadergraphql-yogagraphql-requestMSW@pothos/core