add_portal_admin_api_query

Create Portal Admin GraphQL query files with pagination metadata and run gentype.

2.0k|126|Updated Jun 16, 2020
One-click install
npx skills add https://github.com/authgear/authgear-server --skill add-portal-admin-api-query
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add_portal_admin_api_query
Source: https://github.com/authgear/authgear-server/tree/main/.claude/skills/add_portal_admin_api_query
Command: npx skills add https://github.com/authgear/authgear-server --skill add-portal-admin-api-query

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Ensures that every Portal Admin GraphQL query added under portal/src/graphql/adminapi/query adheres to the existing schema, naming conventions, and pagination expectations so portal APIs stay consistent and predictable.

Core Features & Use Cases

  • Schema fidelity: Read portal/src/graphql/adminapi/schema.graphql first and reference only existing fields to prevent inventing unsupported schema entries.
  • Query creation: Create the .graphql file in portal/src/graphql/adminapi/query, include cursor, pageInfo, and totalCount whenever pagination applies, and avoid nested entity selections unless explicitly requested.
  • Generation & validation: Run cd ./portal && npm run gentype after adding or updating the query file to regenerate portal type definitions and keep client code in sync.

Quick Start

Create a new Portal Admin GraphQL query named <query name> under portal/src/graphql/adminapi/query while following the schema, include pagination metadata when required, and run npm run gentype from the portal directory.

Frequently Asked Questions about add_portal_admin_api_query

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

FAQPage Schema
How do I add a Portal Admin GraphQL query while following the existing schema?

To add a Portal Admin GraphQL query, create a new .graphql file under portal/src/graphql/adminapi/query. You must first reference portal/src/graphql/adminapi/schema.graphql to ensure you only use existing fields and respect established naming conventions for portal operations.

How does pagination work for GraphQL queries in the portal admin API?

Pagination for portal admin API queries requires including cursor, pageInfo, and totalCount metadata in your .graphql file whenever the query supports pageable results. This ensures portal APIs return predictable and consistent pagination structures.

What is the process for regenerating portal type definitions after adding a GraphQL query?

Regenerating portal type definitions requires running the command npm run gentype inside the portal directory. This npm script syncs client code with the newly added or updated GraphQL query files.

Can I include nested entity selections when creating portal admin GraphQL queries?

Nested entity selections should be avoided when creating portal admin GraphQL queries unless explicitly requested. The query creation process emphasizes respecting entity field scope to maintain schema fidelity and prevent querying unsupported data.

Why should I reference schema.graphql before creating a portal admin API query?

Referencing schema.graphql prevents inventing unsupported schema entries. Reading portal/src/graphql/adminapi/schema.graphql first ensures your new query adheres to existing fields, maintaining schema fidelity across the portal admin API.