Skip to content

Document CQRS command/query separation rule for API endpoints#252

Merged
xenobiasoft merged 1 commit into
mainfrom
docs/cqrs-api-separation-guidance
May 1, 2026
Merged

Document CQRS command/query separation rule for API endpoints#252
xenobiasoft merged 1 commit into
mainfrom
docs/cqrs-api-separation-guidance

Conversation

@xenobiasoft
Copy link
Copy Markdown
Owner

Summary

  • Adds a CQRS Command vs Query Separation subsection to the API Design Guidelines with an explicit rule: command endpoints must not return domain data — only an HTTP status code
  • Replaces the existing CreateGame controller example (which incorrectly returned GameDto from a command) with two clearly labelled examples showing a command endpoint returning 201 Created with no body and a query endpoint returning data
  • Adds item 8 to the Anti-Patterns list: Returning data from command endpoints

Test plan

  • Review the updated agents.md guidance for clarity and accuracy

🤖 Generated with Claude Code

Adds explicit guidance that command endpoints must not return domain
data — only a status code — and that queries are the sole place to
read state. Updates the REST controller example to show a command
returning 201 with no body alongside a query returning data, and adds
the pattern to the anti-patterns list.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Azure Static Web Apps: Your stage site is ready! Visit it here: https://gray-bush-02024e71e-252.westus2.7.azurestaticapps.net

@xenobiasoft xenobiasoft merged commit e42c00e into main May 1, 2026
8 checks passed
@xenobiasoft xenobiasoft deleted the docs/cqrs-api-separation-guidance branch May 1, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant