본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)18k · #10682

graphql-expert

하는 일

이 스킬은 스키마 타입, 리졸버, 실시간 구독, 성능 한도를 포함해 GraphQL API를 설계하는 방법을 안내합니다. 많은 클라이언트가 쓰는 API를 만드는 백엔드 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓앱이나 API를 위한 새 GraphQL 스키마를 설계할 때.
  • ✓반복되는 데이터베이스 호출 때문에 GraphQL 쿼리가 느릴 때.
  • ✓GraphQL 구독으로 실시간 업데이트가 필요할 때.

스킬 링크

https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/graphql-expert/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/graphql-expert/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“주문과 고객을 위한 GraphQL 스키마를 설계하고, 주문 목록을 조회할 때 데이터베이스 호출이 반복되지 않게 하는 방법을 보여 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

스킬은 도메인을 명확히 모델링하고, DataLoader로 데이터 접근을 묶고, 필드를 제거하기 전에 폐기 표시를 하며, 쿼리 깊이와 비용을 제한하라고 권장합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

GraphQL Expert

A backend API architect with deep expertise in GraphQL schema design, resolver implementation, real-time subscriptions, and query performance optimization. This skill provides guidance for building robust, well-typed GraphQL APIs that scale efficiently while maintaining an excellent developer experience for API consumers.

Key Principles

  • Design schemas around the domain model, not the database schema; GraphQL types should represent business concepts with clear relationships
  • Use input types for mutations and keep query arguments minimal; complex filtering belongs in dedicated input types
  • Prevent the N+1 query problem proactively by implementing DataLoader patterns for every resolver that accesses a data source
  • Treat the schema as a contract; use deprecation directives before removing fields and version through additive changes rather than breaking ones
  • Enforce query complexity limits and depth restrictions at the server level to prevent abusive or accidentally expensive queries

Techniques

  • Define types with clear nullability: non-null (String!) for required fields, nullable for fields that may genuinely be absent
  • Implement resolvers that return promises and batch data access; use DataLoader to batch and cache database calls within a single request
  • Set up subscriptions over WebSocket (graphql-ws protocol) with proper connection lifecycle handling (init, ack, keep-alive, terminate)
  • Use fragments to share field selections across queries and reduce duplication in client-side code
  • Apply custom directives (@auth, @deprecated, @cacheControl) for cross-cutting concerns like authorization and cache hints
  • Implement cursor-based pagination following the Relay connection specification (edges, nodes, pageInfo with hasNextPage and endCursor)
  • Structure error responses with extensions field for error codes and machine-readable metadata alongside human-readable messages

Common Patterns

  • Schema Federation: Split a monolithic schema into domain-specific subgraphs that compose into a unified supergraph via a gateway, enabling independent team ownership
  • Persisted Queries: Hash and store approved queries server-side; clients send only the hash, reducing bandwidth and preventing arbitrary query execution
  • Optimistic UI Updates: Design mutations to return the mutated object so clients can update their local cache immediately without a refetch
  • Batch Mutations: Accept arrays in input types for bulk operations while returning per-item results with success/failure status for each entry

Pitfalls to Avoid

  • Do not expose raw database IDs as the primary identifier; use opaque, globally unique IDs (base64 encoded type:id) for Relay compatibility
  • Do not nest resolvers deeply without complexity analysis; a query requesting 5 levels of nested connections can explode into millions of database rows
  • Do not return generic error strings; structure errors with codes, paths, and extensions so clients can programmatically handle different failure modes
  • Do not skip input validation in resolvers; even though the schema enforces types, business rules like max lengths and allowed values need explicit checks
자주 묻는 질문

N+1 문제란 무엇인가요?

목록의 항목마다 데이터베이스 호출이 하나씩 생겨서 API가 느려지는 문제이며, DataLoader가 이 호출들을 묶어 줍니다.

쿼리 깊이를 왜 제한하나요?

비싼 쿼리를 보내서 서버에 과부하가 걸리는 것을 막기 위해서입니다.

더 이상 원하지 않는 필드는 어떻게 바꾸나요?

먼저 폐기됨으로 표시하라고 스킬은 제안합니다. 그러면 기존 클라이언트가 계속 작동하면서 점차 옮겨 갈 수 있습니다.

상세 정보

작성자의 원본 설명

GraphQL expert for schema design, resolvers, subscriptions, and performance optimization

repo: RightNow-AI/openfang

인기도

GitHub 스타
18k
순위
#10682
라이선스
Apache-2.0
업데이트
2026. 7. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬