Skip to content

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

Merged
jdaugherty merged 1 commit into
8.1.xfrom
refactor/graphql-testing-util
Sep 30, 2026
Merged

jdaugherty merged 1 commit into
8.1.xfrom
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

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 59.2332%. Comparing base (c4d5f26) to head (eb36646).
⚠️ Report is 38 commits behind head on 8.1.x.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##                8.1.x     #16206   +/-   ##
=============================================
  Coverage     59.2332%   59.2332%           
  Complexity      25121      25121           
=============================================
  Files            2215       2215           
  Lines          108863     108863           
  Branches        19798      19798           
=============================================
  Hits            64483      64483           
+ Misses          35445      35443    -2     
- Partials         8935       8937    +2     

see 4 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

This comment has been minimized.

@jdaugherty
jdaugherty force-pushed the test/grails-data-graphql-coverage branch from 36b7716 to df7efef Compare September 23, 2026 21:15
Base automatically changed from test/grails-data-graphql-coverage to 8.0.x September 23, 2026 21:16
@jdaugherty
jdaugherty changed the base branch from 8.0.x to 8.1.x September 30, 2026 14:14
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>
@jdaugherty
jdaugherty force-pushed the refactor/graphql-testing-util branch from b4c7b5c to eb36646 Compare September 30, 2026 14:24
@jdaugherty
jdaugherty merged commit 838d992 into 8.1.x Sep 30, 2026
77 of 80 checks passed
@jdaugherty
jdaugherty deleted the refactor/graphql-testing-util branch September 30, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants