new-graphql-field
БесплатноБез исполняемых скриптовНе проверенAdd a new GraphQL query or mutation end-to-end (schema → resolver → frontend)
от clidey★ 5 073 звезды на GitHubОб этом скилле
Add a New GraphQL Field
Steps
1. Update Schema
Edit core/graph/schema.graphqls.
Use source-first naming for public queries:
type Query {
SourceNewFeature(input: SourceObjectRefInput!): SourceNewFeatureResult!
}
Classify every new root field before implementing its resolver:
- Protected is the default and requires no policy entry.
- If unauthenticated access is an explicit requirement, add the actual root
field name to the public-field policy in
core/src/auth/graphql_authorization.go. - Never authorize by GraphQL operation name. See
.agents/rules/graphql.md.
2. Run Codegen
The agent hook runs cd core && go generate . and cd frontend && pnpm run generate
after a .graphqls edit. Without the hook, run both. Backend codegen creates the
resolver stubs in *.resolvers.go; frontend codegen reads the schema file, so the
backend does not need to be running.
3. Implement Resolver
Fill in the generated stub. Source-first resolvers should:
- Look up the plugin via the source adapter
- Call the appropriate
PluginFunctionsmethod - Return the source-typed result
4. Add Plugin Method (if new capability)
- Add to
PluginFunctionsinterface incore/src/engine/plugin.go - Add defaults in
core/src/plugins/gorm/andcore/src/engine/base_plugin.go(returnerrors.ErrUnsupportedif not universally applicable) - Implement in relevant plugins
- If the capability is public, declare it in the source contract (
core/src/sourcecatalog/catalog.go)
5. Create Frontend Operation
Add a .graphql file next to the component or in frontend/src/graphql/ (codegen reads src/**/*.graphql):
query SourceNewFeature($input: SourceObjectRefInput!) {
SourceNewFeature(input: $input) {
...fields
}
}
Then run cd frontend && pnpm run generate to get the typed hook (the hook does not run for .graphql operation files).
6. Use in Component
import { useSourceNewFeatureQuery } from '@graphql';
const { data, loading } = useSourceNewFeatureQuery({ variables: { input } });
7. Verification
cd core && go build ./cmd/whodb && go vet ./...
cd frontend && pnpm run build:ce
For public fields or authorization-sensitive changes, add a regression that uses a misleading public-looking operation name with a protected selected field and proves the operation is rejected before resolver execution.
Установить new-graphql-field в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл new-graphql-field?
Add a new GraphQL query or mutation end-to-end (schema → resolver → frontend)
Как установить скилл new-graphql-field?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл new-graphql-field запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic