Agent Skills › authgear/authgear-server › add-portal-admin-api-query

add-portal-admin-api-query

GitHub

指导在 Portal Admin 中添加 GraphQL 查询的标准流程,包括读取 schema、创建文件、处理分页及类型生成。

.claude/skills/add-portal-admin-api-query/SKILL.md authgear/authgear-server

Trigger Scenarios

需要添加 Portal Admin GraphQL 查询 前端页面需要特定数据且需服务端过滤

Install

npx skills add authgear/authgear-server --skill add-portal-admin-api-query -g -y
More Options

Non-standard path

npx skills add https://github.com/authgear/authgear-server/tree/main/.claude/skills/add-portal-admin-api-query -g -y

Use without installing

npx skills use authgear/authgear-server@add-portal-admin-api-query

指定 Agent (Claude Code)

npx skills add authgear/authgear-server --skill add-portal-admin-api-query -a claude-code -g -y

安装 repo 全部 skill

npx skills add authgear/authgear-server --all -g -y

预览 repo 内 skill

npx skills add authgear/authgear-server --list

SKILL.md

Frontmatter
{
    "name": "add-portal-admin-api-query",
    "description": "Add a Portal Admin GraphQL query under portal\/src\/graphql\/adminapi\/query.",
    "argument-hint": "<query name>"
}

Follow this skill when adding a Portal Admin GraphQL query.

Workflow

  1. Read ./portal/src/graphql/adminapi/schema.graphql first.
  2. Create the .graphql file under ./portal/src/graphql/adminapi/query.
  3. Include cursor, pageInfo, and totalCount when the query supports pagination and the user did not ask to omit them.
  4. Query the fields of the entity itself, but avoid nested entities unless the user asked for them.
  5. Fetch only the records the screen needs, filtered on the server by what it already knows (the IDs on its rows). Do not list a whole collection to pick items out on the client: page size is silently capped, usually at 100. If the schema has no such filter, stop and propose the API change instead of working around it — see "Query only the data the screen needs" in the update-portal-ui skill.
  6. Run cd ./portal && npm run gentype after adding the file.

Notes

  • Keep the operation name consistent with existing Portal GraphQL naming.
  • Do not invent schema fields; use only what exists in the schema file.

Version History

  • 8690720 Current 2026-10-19 04:00

    新增错误处理、查询范围限制和常量复用规则;修正因静默分页截断导致的数据缺失问题。

  • 2dd6d88 2026-07-24 16:30

Same Skill Collection

.claude/skills/add-go-test/SKILL.md
.claude/skills/add-portal-admin-api-mutation/SKILL.md
.claude/skills/add-portal-screen/SKILL.md
.claude/skills/api-design/SKILL.md
.claude/skills/bootstrap-local-dev/SKILL.md
.claude/skills/dep-audit/SKILL.md
.claude/skills/generate-schemas-and-gentype/SKILL.md
.claude/skills/new-siteadmin-api/SKILL.md
.claude/skills/review-pr/SKILL.md
.claude/skills/update-configs/SKILL.md
.claude/skills/update-deps/SKILL.md
.claude/skills/update-email-templates/SKILL.md
.claude/skills/update-feature-config/SKILL.md
.claude/skills/update-important-modules/SKILL.md
.claude/skills/update-portal-ui/SKILL.md
.claude/skills/update-vettedpositions/SKILL.md
.claude/skills/write-e2e-test/SKILL.md
.claude/skills/write-implementation-plan/SKILL.md
.claude/skills/update-go-version/SKILL.md
.claude/skills/portal-admin-api-graphql/SKILL.md

Metadata

Files
0
Version
8690720
Hash
77d94b0b
Indexed
2026-07-24 16:30

홈 - 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-21 03:48
浙ICP备14020137号-1