Skip to content

test: cover same field aliased with different arguments#71

Open
fahchen wants to merge 1 commit into
mainfrom
test/alias-same-field-different-args
Open

test: cover same field aliased with different arguments#71
fahchen wants to merge 1 commit into
mainfrom
test/alias-same-field-different-args

Conversation

@fahchen

@fahchen fahchen commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add regression test verifying the same field can be aliased multiple times with different arguments in one selection set (e.g. { author: user(id: "1") { name email } editor: user(id: "2") { name } }).
  • Test asserts three things end to end: independent struct per alias, both argument sets preserved by the Printer, and response decoded by alias key.

This behavior was already supported by the existing alias machinery (field_name/1 keys structs by alias, args live on query_field and flow through the Printer); the prior alias test only covered same arguments. No production code changed.

Test plan

  • mix test test/typed_gql/type_generator_test.exs — 22 tests, 0 failures
  • mix precommit — credo / dialyzer / full suite (655 tests) all green

🤖 Generated with Claude Code

Locks in that one field queried twice under distinct aliases with
distinct arguments generates independent structs, preserves both
argument sets in the printed query, and decodes by alias.

Co-Authored-By: Claude Opus 4.7 <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.

1 participant