Skip to content

refactor(grails-data-graphql): honor explicit mergedField in MockDataFetchingEnvironment - #16206

Open
borinquenkid wants to merge 1 commit into
test/grails-data-graphql-coveragefrom
refactor/graphql-testing-util
Open

refactor(grails-data-graphql): honor explicit mergedField in MockDataFetchingEnvironment#16206
borinquenkid wants to merge 1 commit into
test/grails-data-graphql-coveragefrom
refactor/graphql-testing-util

Conversation

@borinquenkid

Copy link
Copy Markdown
Member

Summary

Stacked on #16201. MockDataFetchingEnvironment#getMergedField() always rebuilt a MergedField from fields, ignoring the settable mergedField property entirely - it was flagged as unused. Now falls back to building from fields only when mergedField isn't explicitly set, so test authors can stub a MergedField directly. Adds MockDataFetchingEnvironmentSpec, the first dedicated spec for this public testing utility.

Test plan

  • ./gradlew :grails-data-graphql-core:test :grails-data-graphql:test :grails-data-graphql-core:codeStyle :grails-data-graphql:codeStyle passes

🤖 Generated with Claude Code

getMergedField() always rebuilt a MergedField from `fields`, ignoring
the settable `mergedField` property entirely - it was never read
anywhere. Fall back to building from fields only when mergedField
isn't set, so test authors can stub a MergedField directly (e.g. one
with a custom name/alias that the fields-list constructor path can't
express) instead of only being able to set it indirectly via fields.

Added MockDataFetchingEnvironmentSpec, the first dedicated spec for
this public testing utility, covering both the fields-derived default
and the explicit-mergedField override.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 23, 2026 16:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.4199%. Comparing base (36b7716) to head (b4c7b5c).

Additional details and impacted files

Impacted file tree graph

@@                             Coverage Diff                             @@
##             test/grails-data-graphql-coverage     #16206        +/-   ##
===========================================================================
+ Coverage                              53.4149%   53.4199%   +0.0050%     
- Complexity                               19459      19460         +1     
===========================================================================
  Files                                     2081       2081                
  Lines                                    98993      98993                
  Branches                                 17361      17361                
===========================================================================
+ Hits                                     52877      52882         +5     
+ Misses                                   38566      38562         -4     
+ Partials                                  7550       7549         -1     

see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@testlens-app

testlens-app Bot commented Aug 23, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: b4c7b5c
▶️ Tests: 47656 executed
⚪️ Checks: 70/70 completed


Learn more about TestLens at testlens.app/docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants