Repository navigation
Add orderNavigationsByKey option - #1458
Merged
Merged
Conversation
A projected navigation list or connection field with no orderBy argument is ordered by its key. For a model with EfOrderBy default ordering that replaced the default, since EfOrderBy leaves an already ordered collection as it is, so a client that left out orderBy got the items in key order. orderNavigationsByKey, on by default, can now be turned off in RegisterInContainer and the EfGraphQLService constructor. Off, such a collection is left unordered, and EfOrderBy 1.4 orders it by the configured default. An orderBy argument is still applied. Version bumped to 36.3.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds
orderNavigationsByKeytoRegisterInContainerand theEfGraphQLServiceconstructor, on by default.A projected navigation list or connection field with no
orderByargument is ordered by its key, for a deterministic result. For a model with EfOrderBy default ordering that replaced the default, since EfOrderBy leaves a collection that is already ordered as it is. A client that left outorderBybecause it matched the model's default got the items in key order instead, which for a Guid key looks random.With the option off, such a collection is left unordered, and EfOrderBy 1.4 (SimonCropp/EntityFramework.OrderBy#184) orders it by the configured default.
orderByargument is still applied, and replaces the defaultTests run the same parent and child query with the option on, off, and off with an
orderByargument. The test project is on EfOrderBy 1.3.0, which does not order projections, so with the option off the snapshot shows no child ordering. Run against a local build of EfOrderBy 1.4, that snapshot gainsc.Property, the child's configured default, and no other test changes.Documented under configuration. Version bumped to 36.3.0.