Skip to content

Add splitSideBySideCollections option - #1455

Merged
SimonCropp merged 1 commit into
mainfrom
split-side-by-side-collections
Oct 28, 2026
Merged

SimonCropp merged 1 commit into
mainfrom
split-side-by-side-collections

Conversation

@SimonCropp

Copy link
Copy Markdown
Owner

Adds an opt-in splitSideBySideCollections to RegisterInContainer and the EfGraphQLService constructor, off by default.

A resolver cannot know which collections a request will select, so calling AsSplitQuery per field only fixes the requests already seen. With the option on, ApplyProjection counts the collections the request's projection loads side by side, and calls AsSplitQuery when there are two or more.

  • Nested collections do not multiply rows, so a chain of them counts as one and stays a single query
  • A reference navigation passes on the collections under it
  • A resolver that called AsSplitQuery or AsSingleQuery keeps its choice
  • AsSplitQuery is in Microsoft.EntityFrameworkCore.Relational, which is now referenced

Tests cover the counting. No integration test runs a query with the option on, since the test model has no entity with two collections side by side.

Documented under configuration. Version bumped to 36.2.0.

Opt in, through RegisterInContainer or the EfGraphQLService constructor, to
AsSplitQuery for a request that selects collections side by side, which
multiply each other's rows in a single query. Nested collections do not
multiply, so do not trigger it. A resolver that called AsSplitQuery or
AsSingleQuery keeps its choice.

AsSplitQuery is in Microsoft.EntityFrameworkCore.Relational, which is now
referenced.

Bump to 36.2.0.
@SimonCropp SimonCropp added this to the 36.2.0 milestone Oct 28, 2026
@SimonCropp
SimonCropp merged commit ab98da4 into main Oct 28, 2026
5 checks passed
@SimonCropp
SimonCropp deleted the split-side-by-side-collections branch October 28, 2026 10:14
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.

1 participant