graphql
Installation
SKILL.md
GraphQL
Overview
Design, build, and consume GraphQL APIs. This skill covers schema-first and code-first approaches, resolver patterns, real-time subscriptions, authentication, performance optimization with DataLoader, pagination, federation for microservices, and client-side consumption with Apollo Client.
Instructions
Step 1: Project Setup
Server (Apollo Server):
npm install @apollo/server graphql@16 # Apollo Server 5 needs graphql 16.11+ (not 17)
npm install express cors @as-integrations/express4 # Express 5: @as-integrations/express5
npm install dataloader graphql-subscriptions # N+1 batching, PubSub
npm install graphql-ws ws @graphql-tools/schema # subscriptions over WebSocket
Apollo Server 5 no longer ships @apollo/server/express4; expressMiddleware now comes from the separate @as-integrations/express4 package. Without Express, startStandaloneServer from @apollo/server/standalone is enough.