AGENT SKILL

ac-graphql-and-streaming-apis

Designing GraphQL schemas and streaming interfaces that stay fast: schema shape and nullability, the N+1 problem and dataloader batching, query depth and cost limits, federation across services, pagination with cursors, subscriptions and server-sent events, and the written interface record. It explains how these interfaces behave under load; it never recommends a framework and never guarantees a latency. Use when asking "GraphQL schema design", "N+1 queries", "dataloader", "query depth limit", "GraphQL federation", "cursor pagination", "subscription versus SSE", "why is my GraphQL slow", "query cost analysis". Not for REST resource and versioning decisions (ac-api-design), not for event-driven messaging between services (ac-event-driven-architecture), not for transport security and injection (ac-security-engineer).

License 许可
MIT
最近更新
2026-11-15
Stars
★ 81
Forks
17

01 前言 Front Matter

name
ac-graphql-and-streaming-apis
status
seedling
license
MIT
metadata
{ "domain": "software-engineering" }
description
Designing GraphQL schemas and streaming interfaces that stay fast: schema shape and nullability, the N+1 problem and dataloader batching, query depth and cost limits, federation across services, pagination with cursors, subscriptions and server-sent events, and the written interface record. It explains how these interfaces behave under load; it never recommends a framework and never guarantees a latency. Use when asking "GraphQL schema design", "N+1 queries", "dataloader", "query depth limit", "GraphQL federation", "cursor pagination", "subscription versus SSE", "why is my GraphQL slow", "query cost analysis". Not for REST resource and versioning decisions (ac-api-design), not for event-driven messaging between services (ac-event-driven-architecture), not for transport security and injection (ac-security-engineer).

02 资源文件 10

03 SKILL.md 正文

GraphQL and streaming APIs

Overview

GraphQL and streaming interfaces invert control: the client decides what it wants and the server must satisfy that request without knowing in advance what it will be. That flexibility is the attraction and the problem. A schema that permits arbitrary traversal permits expensive queries; a subscription that delivers every change delivers too many; and a resolver that looks trivial becomes a fan-out when the client asks for a list.

This skill covers the mechanics that make those interfaces work: how schema shape and nullability constrain clients, why the N+1 pattern appears and how batching addresses it, how depth and cost limits bound a query before it runs, how federation splits a graph across teams, how cursor pagination stays stable, and where subscriptions differ from server-sent events. REST contracts and event messaging belong to other skills.

Primary sources: https://graphql.org/ and https://www.w3.org/.

When to use

  • When designing or reviewing a GraphQL schema.
  • When a GraphQL endpoint is slow and the cause is suspected to be resolver fan-out.
  • When splitting a graph across services or teams.
  • When choosing between subscriptions and server-sent events.

When NOT to use

  • For REST resource modelling and versioning (use ac-api-design).
  • For service-to-service messaging and event schemas (use ac-event-driven-architecture).
  • For authentication, injection, and abuse controls (use ac-security-engineer).

Subskill Index

Leaf Domain segment Scope (one line)
subskills/schema-shape-and-nullability.md software-engineering/schema-shape-and-nullability Types, nullability, and the client behaviour each choice forces.
subskills/n-plus-one-and-batching.md software-engineering/n-plus-one-and-batching Resolver fan-out, dataloader batching, and the request-scoped cache.
subskills/query-cost-and-depth.md software-engineering/query-cost-and-depth Depth limits, cost analysis, and rejecting expensive queries before execution.
subskills/federation-and-schema-ownership.md software-engineering/federation-and-schema-ownership Splitting a graph across teams without creating a distributed monolith.
subskills/cursor-pagination.md software-engineering/cursor-pagination Stable cursors, ordering, and why offset pagination breaks.
subskills/subscriptions-and-sse.md software-engineering/subscriptions-and-sse Push transport choice, delivery guarantees, and reconnection.
subskills/graphql-interface-record.md software-engineering/graphql-interface-record The written record: schema, limits, cost model, and ownership.

Status and honest limits

GraphQL tooling changes faster than the principles, and a specific server library's behaviour may differ from the general pattern described here. Cost analysis is an approximation of database work and never an exact bound, so limits reject the obviously expensive rather than the truly expensive. Nothing here guarantees a latency, and a schema that is well designed can still be slow if the resolvers behind it are.

04 同仓库更多 Skills

jiayaoqijia
jiayaoqijia/cryptoskill

troves

Deposit and withdraw from Troves DeFi yield vault strategies on Starknet. View available strategies, check positions, and manage vault deposits. Use this skill when the user mentions Troves, vault, yield vault, DeFi vault, strategy, yield farming, vault deposit, vault withdraw, earning yield through vaults, passive yield strategies, or wants to deposit into or withdraw from a yield strategy — even if they don't say "Troves" explicitly.

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

trade

Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say "swap".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

staking

Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say "stake" explicitly.

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

send

Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say "pay 10 STRK to 0x...".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

portfolio

View a comprehensive DeFi portfolio dashboard and optimize portfolio allocation via automated rebalancing. Use this skill when the user wants an overview, summary, dashboard, total value, net worth, portfolio rebalancing, target allocation, or wants to see all their DeFi positions across Starknet at once. Also trigger when the user asks "what do I have", "show me everything", "how much am I worth", "my positions", "my investments", "rebalance my portfolio", "I want 50% ETH", "optimize my holdings", or any request for a holistic view of their Starknet holdings — even if they don't explicitly say "portfolio".

★ 81
jiayaoqijia
jiayaoqijia/cryptoskill

multi-swap

Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions "two swaps", "three swaps", "swap X and Y at the same time", or wants to convert multiple tokens in a single call.

★ 81