Skip to content

Conversation

trkohler
Copy link
Contributor

@trkohler trkohler commented Sep 12, 2025

Define 2 new attributes in resolver info argument:

  • isFieldRequested (function)
  • fieldAvailability (map)

available under feature flag enableFieldAvailability

this should enable more efficient & informant lookaheads because based on the availability, resolver logic can be simplified and unnecessary calls avoided.

the information is available only for immediate children fields.
if the alias is used for a field, in fieldAvailability the field is available under it's real name

troy-kohler_zse and others added 6 commits September 12, 2025 19:41
This adds an experimental feature flag to enable fieldAvailability and
isFieldRequested on GraphQLResolveInfo, allowing resolvers to detect
which fields are requested after skip/include directives are applied.
Includes a comprehensive test suite for various directive scenarios.
Fragment support is limited in this initial implementation.
@trkohler trkohler changed the title expose helpful functions so users can perform lookaheads with respect to @skip / @include directives expose helpful attributes so users can perform lookaheads with respect to @skip / @include directives Sep 12, 2025
generation

- Add comprehensive unit tests for createFieldAvailability and
  generateFieldAvailabilityCode, including handling of directives,
  path-based conditions, and error cases
- Add integration tests for complex GraphQL queries with nested objects,
  aliases, lists, and conditional fields
- Ensure tests verify parent-child separation and correct field
  availability for each resolver
- Document fragment support limitations in tests and verify fallback
  behavior
@boopathi boopathi self-assigned this Sep 21, 2025
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.

2 participants