This repository has been archived by the owner on Mar 31, 2022. It is now read-only.
Support sort by instance name #202
Merged
zaharchenko-evgeny
merged 2 commits into
master
from
feature/support_multiple_sort_by_and_instance_name_in_filters
Jan 14, 2022
Merged
Support sort by instance name #202
zaharchenko-evgeny
merged 2 commits into
master
from
feature/support_multiple_sort_by_and_instance_name_in_filters
Jan 14, 2022
Conversation
This file contains 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
Support multiple sort conditions for query
This was referenced Jan 13, 2022
vadimbasko
reviewed
Jan 13, 2022
@@ -128,4 +127,20 @@ class SortingTest extends AbstractGraphQLTest { | |||
garNames == ["Big Bob's Beeper Emporium", "The Fudge Place", "Watch Repair", "P.S. 118"] | |||
} | |||
|
|||
def "cars are sorted by garage"() { | |||
when: | |||
def response = query("datafetcher/sort/cars-with-sort.gql", |
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.
Also need test with first-level sort sort by _instanceName
def response = query("datafetcher/sort/cars-with-sort.gql",
asObjectNode('{"orderBy": {"_instanceName": "ASC"}}'))
vadimbasko
reviewed
Jan 13, 2022
Map<String, Object> innerOrderBy = new LinkedHashMap<>(); | ||
for (String key : valueObj.keySet()) { | ||
if (key.equals(SYS_ATTR_INSTANCE_NAME)) { | ||
for (MetaProperty metaProperty : metadataTools.getInstanceNameRelatedProperties(metaClass)) { |
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.
May be it make sense to add comment here, that there is a case when properties may be returned in a different order from the order in which they were used in instance name.
vadimbasko
approved these changes
Jan 13, 2022
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.
Need to be checked that first-level sort by _instanceName
works. Than PR could be merged.
zaharchenko-evgeny
deleted the
feature/support_multiple_sort_by_and_instance_name_in_filters
branch
January 14, 2022 07:02
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Support multiple sort conditions for query and support sort by entity instance name