ddd-query-options-specialist

Parse and validate OData-style QueryOptions for DDD-based APIs.

3|Updated Feb 12, 2024
One-click install
npx skills add https://github.com/mgamadeus/ddd --skill ddd-query-options-specialist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ddd-query-options-specialist
Source: https://github.com/mgamadeus/ddd/tree/main/.claude/skills/ddd-query-options-specialist
Command: npx skills add https://github.com/mgamadeus/ddd --skill ddd-query-options-specialist

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The QueryOptions specialist helps developers implement, validate, and debug OData-style query parameters (filters, sorts, expands, selects, and pagination) for DDD-based APIs, reducing boilerplate and errors.

Core Features & Use Cases

  • Auto-detects filterable and expandable properties on entities and entity sets
  • Parses and validates query options from DTOs, controllers, and services
  • Provides an expand() method to lazily load related data while applying scoped options

Quick Start

Configure a sample Resource endpoint to accept $filter, $expand, and $select and run a request to observe the QueryOptions results.

Frequently Asked Questions about ddd-query-options-specialist

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

FAQPage Schema
How do I implement OData-style query options like $filter and $expand in a DDD-based API?

To implement OData query options in a DDD-based API, parse and validate parameters like $filter, $expand, and $select directly from controllers and services. This approach auto-detects filterable properties and applies scoped options to reduce boilerplate.

What is the best way to auto-detect filterable and expandable properties for API entities?

The best way to auto-detect filterable and expandable properties is to apply a QueryOptions parser that inspects entities and entity sets. This automatically identifies valid fields for filtering and relation loading, ensuring controlled data shaping without manual definitions.

How do I lazy-load related data while applying scoped query options to DTOs?

To lazy-load related data with scoped query options, call an expand() method on your parsed QueryOptions. This applies nested relation loading and controlled data shaping to DTOs and services, ensuring only requested relations are fetched.

Can I validate OData query parameters from DTOs before executing API queries?

Yes, you can validate OData query parameters from DTOs by parsing them into structured QueryOptions. This process validates filters, sorts, selects, and pagination rules before they reach the service layer, preventing invalid data querying operations.

How do I debug invalid OData filters and pagination errors in my API endpoints?

To debug invalid OData filters and pagination errors, use a QueryOptions specialist to parse and validate incoming requests. It isolates malformed query parameters during validation, clarifying which filter or expand property failed the data shaping rules.