GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix ExecutableNormalizedField to respect GraphqlFieldVisibility by Samjin · Pull Request #4204 · graphql-java/graphql-java

Conversation

@Samjin

@Samjin Samjin commented Jan 10, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Problem

ExecutableNormalizedField.forEachFieldDefinition() and getOneFieldDefinition() call type.getField(fieldName) directly, bypassing the schema's configured GraphqlFieldVisibility.

This is inconsistent with other parts of graphql-java (validation, execution) that respect field visibility, and causes issues when:

  • A custom GraphqlFieldVisibility provides field definitions that differ from what's in the schema type (e.g., placeholder fields, virtual fields, or dynamically-computed fields)
  • Application code accesses DataFetchingEnvironment.getSelectionSet().getFields() in a DataFetcher
  • Normalization fails with "No field X found for type Y" because it bypasses the visibility

Reproduction

  1. Configure a custom GraphqlFieldVisibility that provides virtual/placeholder fields
  2. Execute a query that includes a field only available through the visibility
  3. Access DataFetchingEnvironment.getSelectionSet().getFields() in a DataFetcher
  4. Normalization fails because ExecutableNormalizedField.forEachFieldDefinition() calls type.getField() directly

Solution

Change the field lookup to use the schema's field visibility:

// Before
type.getField(fieldName)

// After  
schema.getCodeRegistry().getFieldVisibility().getFieldDefinition(type, fieldName)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
sjin
Fix ExecutableNormalizedField to respect GraphqlFieldVisibility
b3552c2
@Samjin Samjin mentioned this pull request Jan 23, 2026
ExecutableNormalizedField does not respect GraphqlFieldVisibility #4215
Closed
bbakerman
bbakerman approved these changes Jan 27, 2026
View reviewed changes

@bbakerman bbakerman left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks for this

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bbakerman bbakerman added this to the 26.x breaking changes milestone Jan 27, 2026
bbakerman
bbakerman approved these changes Jan 27, 2026
View reviewed changes

@bbakerman bbakerman left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bbakerman
bbakerman merged commit 9f18071 into graphql-java:master Jan 27, 2026
4 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Samjin

Samjin commented Feb 10, 2026

Copy link
Copy Markdown
Author

Thanks for this

Hi bbakerman, can we please include this v26 beta? Let me know if you need a hand. Thanks

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@bbakerman bbakerman bbakerman approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

26.x is a breaking change release (ot...

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Samjin @bbakerman
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.