graphql

Design GraphQL schemas, resolvers, and subscriptions for FastAPI and Apollo Server.

1|1|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/PedroHBO/opencode-config-skills --skill graphql-pedrohbo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: graphql
Source: https://github.com/PedroHBO/opencode-config-skills/tree/main/skills/graphql
Command: npx skills add https://github.com/PedroHBO/opencode-config-skills --skill graphql-pedrohbo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pypdf, pdfplumber, pdf2image, and includes scripts (resource) and references (resource) components.

What problem does it solve?

GraphQL APIs can become complex and error-prone when designing schemas, resolvers, and security patterns across Python/FastAPI and Node.js. This skill provides structured guidance, patterns, and examples to build scalable, secure GraphQL services.

Core Features & Use Cases

  • Schema Design guidelines: type definitions, input types, relationships, and correct scalar usage.
  • Resolvers and data access: patterns for Query/Mutation/Subscription with Python (Strawberry) and Node.js (Apollo Server) implementations.
  • Performance and security: DataLoader-based batching to prevent N+1 queries, pagination strategies, and auth checks in context.
  • Cross-framework usage: guidance for FastAPI + Strawberry and Apollo Server setups with shared best practices.

Quick Start

Create a minimal GraphQL schema with a Query type and implement basic resolvers in either FastAPI with Strawberry or Node.js with Apollo to expose a /graphql endpoint.

Frequently Asked Questions about graphql

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design a GraphQL schema with proper input types and relationships?

GraphQL schema design requires defining clear type definitions, structuring relationships correctly, and using appropriate custom scalars. This approach ensures clean typing and robust APIs across Python/FastAPI and Node.js implementations.

How do I prevent N+1 queries in GraphQL resolvers?

Prevent N+1 queries in GraphQL resolvers by implementing DataLoader-based batching. This pattern groups multiple requests into a single batch, significantly optimizing data access performance in both Strawberry and Apollo Server environments.

Can I use Strawberry with FastAPI for code-first GraphQL development?

Yes, you can use Strawberry with FastAPI for code-first GraphQL development. This approach allows you to define schemas directly in Python, implement resolvers for queries and mutations, and expose a /graphql endpoint with proper input validation.

What is the best way to handle pagination and security in Apollo Server?

The best way to handle pagination in Apollo Server is implementing cursor or offset strategies, while security is managed through auth checks in the request context. This ensures secure, scalable data access for Node.js GraphQL services.

How do I implement GraphQL subscriptions with proper error handling?

Implement GraphQL subscriptions by defining subscription types in your schema and creating corresponding resolvers. Ensure proper error handling and clean typing patterns to maintain testable, reliable real-time data delivery in both FastAPI and Apollo Server.

When should I choose a schema-first versus code-first approach for GraphQL?

Choose a schema-first approach when you need strict API contract control and language-agnostic definitions, or code-first when using Strawberry with FastAPI for Python-native typing. Both approaches support clean resolvers, input validation, and testable patterns.