add_portal_admin_api_mutation

Create Portal Admin GraphQL mutations from schema.graphql and run npm 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-mutation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add_portal_admin_api_mutation
Source: https://github.com/authgear/authgear-server/tree/main/.claude/skills/add_portal_admin_api_mutation
Command: npx skills add https://github.com/authgear/authgear-server --skill add-portal-admin-api-mutation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures every Portal Admin GraphQL mutation is created in line with the schema, preventing ad-hoc or inconsistent mutation definitions.

Core Features & Use Cases

  • Schema-first mutation creation: Read portal/src/graphql/adminapi/schema.graphql before authoring the new operation so you only use existing fields.
  • Guided mutation placement: Create the .graphql file under portal/src/graphql/adminapi/mutations, query all top-level fields, and avoid nested entities unless explicitly requested.
  • Type generation handshake: Run npm run gentype from the portal directory after adding the mutation to keep generated types in sync. Use case: When adding a Portal Admin mutation for a new admin workflow, follow the schema and generation steps to keep the API consistent.

Quick Start

Add a new Portal Admin mutation file under portal/src/graphql/adminapi/mutations after reviewing the schema.graphql and finish by running npm run gentype from the portal directory.

Frequently Asked Questions about add_portal_admin_api_mutation

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

FAQPage Schema
How do I add a Portal Admin GraphQL mutation that matches the existing schema?

To add a Portal Admin GraphQL mutation, first read portal/src/graphql/adminapi/schema.graphql to verify available fields, then create the .graphql file under portal/src/graphql/adminapi/mutations. This schema-first approach prevents inconsistent or ad-hoc mutation definitions.

What is the correct workflow for adding admin API mutations in a portal?

The correct workflow for adding admin API mutations involves reading the schema.graphql file, creating the new mutation file under the mutations directory querying top-level fields, and running npm run gentype from the portal directory to synchronize generated TypeScript types.

Do I need to run npm run gentype after creating a new portal mutation?

Yes, you must run npm run gentype from the portal directory after adding a new mutation. This type generation handshake updates generated types to reflect the new GraphQL operations, keeping the admin API consistent and type-safe.

Can I query nested entities when creating a portal admin mutation?

You should avoid querying nested entities when creating a portal admin mutation unless explicitly requested. The standard practice is to query only top-level fields from the schema.graphql to maintain consistency and prevent overly complex mutation definitions.

Why do my generated types mismatch after adding a portal admin GraphQL mutation?

Generated types mismatch after adding a portal admin GraphQL mutation because the type generation handshake was skipped. You must run npm run gentype from the portal directory after creating the mutation file to synchronize the generated types with your new schema operations.

What's the best way to expand admin operations without breaking schema fidelity?

The best way to expand admin operations while maintaining schema fidelity is to review portal/src/graphql/adminapi/schema.graphql before file creation, place the mutation under the mutations directory, and execute npm run gentype to keep generated types synchronized.