Skip to content

Conversation

tobias-tengler
Copy link
Member

@tobias-tengler tobias-tengler commented Oct 13, 2025

Debug.Assert calls are removed in Release builds, so the enumerator was never advanced in those cases leading to an exception for operations querying affected fields.

Also fixes that __typename on any introspection type like __Schema always returned Query.

@Copilot Copilot AI review requested due to automatic review settings October 13, 2025 16:55
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a critical bug where Debug.Assert calls were being used to advance enumerators in release builds, causing enumerators to never advance and resulting in exceptions for operations querying affected fields.

  • Replaces Debug.Assert calls with direct MoveNext() calls in introspection code
  • Fixes TypeNameField to correctly reference the selection set's type instead of the root operation type
  • Adds a new test case to verify __typename functionality on introspection types

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
TypeNameField.cs Fixed to use correct type reference for __typename field resolution
__Type.cs Replaced Debug.Assert with direct MoveNext() calls for enumerator advancement
__Directive.cs Replaced Debug.Assert with direct MoveNext() call for enumerator advancement
IntrospectionTests.cs Added test case and refactored existing test structure
IntrospectionTests.Typename_On_Introspection_Types.yaml Test snapshot for new introspection functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@tobias-tengler tobias-tengler force-pushed the tte/fix-introspection-issues branch from 24dcec1 to 871c19c Compare October 13, 2025 17:01
@tobias-tengler tobias-tengler merged commit 80a6cd4 into main Oct 13, 2025
111 checks passed
@tobias-tengler tobias-tengler deleted the tte/fix-introspection-issues branch October 13, 2025 18:20
Copy link

codecov bot commented Oct 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@3efa242). Learn more about missing BASE report.
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff           @@
##             main   #8805   +/-   ##
======================================
  Coverage        ?       0           
======================================
  Files           ?       0           
  Lines           ?       0           
  Branches        ?       0           
======================================
  Hits            ?       0           
  Misses          ?       0           
  Partials        ?       0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant