Skip to content

Conversation

pavelnikolov
Copy link
Member

@pavelnikolov pavelnikolov commented Aug 27, 2025

SelectedFieldNames now returns dot-delimited nested field paths (e.g. products, products.id, products.category, products.category.id). Intermediate container object/list paths are included so resolvers can check for both a branch (products.category) and its leaves (products.category.id). HasSelectedField and SortedSelectedFieldNames operate on these paths. This aligns behavior with typical resolver projection needs and fixes missing nested selections.

fix #679

@pavelnikolov pavelnikolov requested a review from Copilot August 27, 2025 12:08
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 adds support for nested field paths in GraphQL field selection helpers. The SelectedFieldNames function now returns dot-delimited paths for nested selections (e.g., products.id, products.category.id) instead of just immediate child fields.

Key changes:

  • Modified selection path collection to traverse nested structures recursively
  • Updated API documentation to reflect the new nested path behavior
  • Expanded test coverage to validate nested path functionality

Reviewed Changes

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

File Description
selection.go Updated API documentation and function behavior for nested paths
internal/selections/context.go Refactored path collection logic to support recursive nested traversal
selection_test.go Enhanced test schema and cases to validate nested path selection behavior
CHANGELOG.md Added entry documenting the new nested field path feature

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

@pavelnikolov pavelnikolov merged commit ae5f988 into main Aug 27, 2025
3 checks passed
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.

Nested selected fields support for query
1 participant