backend-api

Expose Drumr data models as GraphQL CRUD with typed actions and validation.

Updated Sep 16, 2025
One-click install
npx skills add https://github.com/slingr-stack/qa-test-drumr --skill backend-api-slingr-stack
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-api
Source: https://github.com/slingr-stack/qa-test-drumr/tree/main/project-management-app/.agents/skills/backend-api
Command: npx skills add https://github.com/slingr-stack/qa-test-drumr --skill backend-api-slingr-stack

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you design and implement Drumr backend APIs without hand-wiring every resolver, so model exposure, custom business endpoints, validation, and predictable errors stay consistent.

Core Features & Use Cases

  • GraphQL CRUD Exposure: Publish @DataModel() entities as API-ready resources with generated create, read, update, and delete operations.
  • Typed Custom Actions: Implement domain-specific endpoints with strongly typed params, typed return values, and clear success or failure unions.
  • Validation and Error Handling: Return framework validation errors, expected business errors, and optimistic locking conflicts in a consistent API shape.
  • Use Case: A backend engineer can expose a Task model, add a StartTask action, enforce state checks before execution, and return user-friendly errors when input or business rules fail.

Quick Start

Ask the Skill to expose a Drumr data model through GraphQL CRUD and add a typed Action with validation, guards, and expected error handling.

Frequently Asked Questions about backend-api

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

FAQPage Schema
How do I expose a data model through GraphQL CRUD without hand-wiring resolvers?

You can expose a data model through GraphQL CRUD by using declarative @DataModel metadata, which automatically generates the create, read, update, and delete operations for your entities. This avoids manually writing resolvers for each endpoint.

How does optimistic locking work with GraphQL mutations in a backend API?

Optimistic locking in a GraphQL backend API prevents concurrent update conflicts by checking version consistency before applying mutations. It returns specific optimistic locking conflict errors within a consistent API error response shape when data versions mismatch.

What is the best way to handle validation errors and business rule failures in a GraphQL API?

The best way to handle validation errors is by using validation-aware union handling and ExpectedError unions. This structure returns framework validation errors and expected business errors in a consistent, strongly typed API response format.

How do I add typed custom actions to a GraphQL backend endpoint?

You can add typed custom actions to a GraphQL backend by declaring @Action metadata with strongly typed parameters and return values. This allows you to implement domain-specific endpoints with clear success or failure unions.

Can I enforce permission checks before executing a custom GraphQL action?

Yes, you can enforce permission checks before executing a custom GraphQL action by applying canExecute guards. These guards validate user permissions and state checks before the action processes, returning user-friendly errors upon failure.

When do I need to use ExpectedError unions in GraphQL API design?

You need to use ExpectedError unions in GraphQL API design when you want to consistently distinguish between successful operations and anticipated business failures. This approach ensures validation flows and expected errors are strongly typed alongside successful return values.