Skip to content

feat: add comments edit, reply and delete#81

Merged
iamfj merged 3 commits intomainfrom
feat/comments-edit-reply-delete
Apr 8, 2026
Merged

feat: add comments edit, reply and delete#81
iamfj merged 3 commits intomainfrom
feat/comments-edit-reply-delete

Conversation

@iamfj
Copy link
Copy Markdown
Member

@iamfj iamfj commented Apr 7, 2026

Summary

Expand the comments domain from create-only to full CRUD + reply: add list, reply, edit, and delete subcommands.

Closes #15

Changes

GraphQL Layer

  • Expanded CommentFields fragment with editedAt, parentId, and user
  • Added UpdateComment and DeleteComment mutations
  • Added ListComments query with pagination support

Service Layer

  • Refactored createComment to use codegen types (CreatedComment)
  • Added type aliases: CreatedComment, UpdatedComment, CommentListItem
  • Added listComments — paginated comment listing for an issue
  • Added replyToComment — threaded reply via parentId
  • Added updateComment — edit comment body
  • Added deleteComment — permanent deletion

Command Layer

  • comments list <issue> — paginated listing with --limit and --after
  • comments reply <comment> — reply to a comment with --body
  • comments edit <comment> — update body with --body
  • comments delete <comment> — delete by UUID
  • Updated COMMENTS_META with new arguments and description

Tests

  • 12 test cases (up from 3) covering all 5 service functions
  • Happy path + error case per function

Architecture

No new resolvers needed — comment IDs are UUID-only. The existing createComment mutation is reused for replies (via parentId). All new functions follow the established layer contract: services use GraphQLClient only, commands delegate through createContext().

Verification

  • npm run check:ci
  • npx tsc --noEmit
  • npm test — 212 tests passed ✅
  • npm run build

@iamfj iamfj force-pushed the feat/comments-edit-reply-delete branch from 75affd7 to 748f39e Compare April 7, 2026 20:10
@iamfj iamfj marked this pull request as ready for review April 7, 2026 20:10
@iamfj iamfj force-pushed the feat/comments-edit-reply-delete branch 2 times, most recently from b6384d5 to 73138d9 Compare April 8, 2026 10:42
iamfj added 3 commits April 8, 2026 12:43
Expand CommentFields fragment with editedAt, parentId, and user.
Add ListComments query, UpdateComment and DeleteComment mutations.

Part of #15
…teComment

Refactor createComment to use codegen types (CreatedComment).
Add type aliases: CreatedComment, UpdatedComment, CommentListItem.

Part of #15
- list <issue>: paginated comment listing with --limit and --after
- reply <comment>: create a threaded reply to a comment
- edit <comment>: update a comment's body
- delete <comment>: permanently delete a comment
- Updated COMMENTS_META with new arguments and description

Closes #15
@iamfj iamfj force-pushed the feat/comments-edit-reply-delete branch from 73138d9 to 87f8737 Compare April 8, 2026 10:43
@iamfj iamfj merged commit 29ad150 into main Apr 8, 2026
5 checks passed
@iamfj iamfj deleted the feat/comments-edit-reply-delete branch April 8, 2026 10:47
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.

comments edit/comments reply would be cool

1 participant