[groupBy] Fix order by nested date field#16135
Merged
Conversation
Contributor
Greptile OverviewGreptile SummaryThis PR fixes ordering by nested date fields when using Key Changes:
The fix ensures that when ordering by date fields in nested relations within grouped queries, the correct GraphQL input type with date granularity support is used. Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Client
participant Schema as Workspace Schema Builder
participant OrderByBase as OrderByBaseGenerator
participant RelationGen as RelationFieldMetadataGqlInputTypeGenerator
participant Parser as GraphQL Query Parser
Note over Schema,OrderByBase: Schema Generation Phase
Client->>Schema: Build OrderByWithGroupBy Input Type
Schema->>OrderByBase: generateFields(isForGroupBy=true)
OrderByBase->>OrderByBase: Process atomic & composite fields
OrderByBase->>RelationGen: generateSimpleRelationFieldOrderByInputType(isForGroupBy=true)
RelationGen->>RelationGen: Check if isForGroupBy flag is set
alt isForGroupBy is true
RelationGen->>RelationGen: Use OrderByWithGroupBy input type
Note right of RelationGen: Supports date granularity for nested date fields
else isForGroupBy is false
RelationGen->>RelationGen: Use regular OrderBy input type
end
RelationGen-->>OrderByBase: Return relation order input fields
OrderByBase-->>Schema: Return all generated fields
Note over Parser: Query Execution Phase
Client->>Parser: Execute query with orderBy on nested date field
Parser->>Parser: prepareForOrderByRelationFieldParsing()
Parser->>Parser: Validate nested field is in groupBy
Parser->>Parser: Apply correct order with date granularity
|
Weiko
reviewed
Nov 27, 2025
...raphql-type-generators/input-types/order-by-input/object-metadata-order-by-base.generator.ts
Outdated
Show resolved
Hide resolved
Contributor
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:32978 This environment will automatically shut down when the PR is closed or after 5 hours. |
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.
Fixes twentyhq/core-team-issues#1935