Skip to content

feat: add Result.assigns and prepare_req/1 for response metadata#65

Merged
fahchen merged 1 commit into
mainfrom
fix/issue-64
Apr 17, 2026
Merged

feat: add Result.assigns and prepare_req/1 for response metadata#65
fahchen merged 1 commit into
mainfrom
fix/issue-64

Conversation

@fahchen

@fahchen fahchen commented Apr 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add assigns field to Grephql.Result for user-defined response metadata
  • Add overridable prepare_req/1 callback to client modules for customizing %Req.Request{} before send
  • Add Grephql.Result.put_resp_assign/3 helper for Req response steps
  • Add guide, README section, and ex_doc configuration

Closes #64

Test plan

  • mix precommit passes (compile, format, credo, dialyzer, 619 tests)
  • Unit tests for put_resp_assign/3 and assigns_from_response/1
  • Integration test: prepare_req override populates assigns
  • Integration test: assigns default to %{} without override
  • Integration test: assigns survive binary-body fallback path
  • ex_doc builds with guide included

🤖 Generated with Claude Code

…data

Allow users to capture arbitrary response metadata (e.g. GraphQL
extensions) by overriding prepare_req/1 in their client module and
using Result.put_resp_assign/3 in Req response steps.

Closes #64

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@fahchen fahchen changed the title feat: add Result.assigns and prepare_req/1 callback for response metadata feat: add Result.assigns and prepare_req/1 for response metadata Apr 17, 2026
@fahchen fahchen merged commit af94a23 into main Apr 17, 2026
5 checks passed
@fahchen fahchen deleted the fix/issue-64 branch April 17, 2026 01:33
fahchen added a commit that referenced this pull request Apr 17, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fahchen added a commit that referenced this pull request Apr 17, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fahchen added a commit that referenced this pull request Apr 17, 2026
## Summary

- Bump version to 0.10.0 for #65 (Result.assigns and prepare_req/1)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

Support extensions field in Result struct

1 participant