-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add alias to groupBy
related object
#1579
feat: Add alias to groupBy
related object
#1579
Conversation
4f9a115
to
925eed4
Compare
Codecov ReportPatch coverage:
@@ Coverage Diff @@
## develop #1579 +/- ##
===========================================
+ Coverage 73.47% 73.50% +0.02%
===========================================
Files 187 188 +1
Lines 19291 19320 +29
===========================================
+ Hits 14174 14200 +26
- Misses 4069 4071 +2
- Partials 1048 1049 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
925eed4
to
dab76d3
Compare
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.
Changes look good Shahzad. I'm just wondering about the author_id
being returned in the results without it being requested in the query. Was this behavious previously the same? In my mind that would be a bug.
I think that is also against the GQL spec, IIRC only (and all) fields requested must be returned. |
I thought it was odd too and against the spec, but I am pretty sure that is the default behavior that already existed. For example: query {
Users(groupBy: [Name]) {
_group {
Age
}
}
} Would probably give: [
{
{
"Name": ...
"_group": [
{
{
"Age": ...
}
...
{
"Age": ...
}
]
}
}
...
{
"Name": ...
"_group": [
{
{
"Age": ...
}
...
{
"Age": ...
}
]
}
}
}
] |
I will add a test case to confirm the behavior.
Can create an issue if this wasn't intentional for some thought-out reason. |
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.
LGTM. I opened an issue so we can come back to fixing the inconsistency with the specs #1582
Thanks for adding the test. Maybe before merging, it would be nice to add a statement in the test that states that this is not wanted behaviour.
Maybe a test like this exist somewhere, I didn't find one can drop this commit if pointed to a test similar to this one.
usecases, if this is a duplicate test let me know I can remove it.
field is not selected.
ed64dd8
to
4b2edff
Compare
Resolves sourcenetwork#1578 Resolves sourcenetwork#1551 Part-of: sourcenetwork#1279 ## Description - Add some tests of existing object_id functionality. - Add implementation for groupBy alias. - Add tests for groupBy alias ability. - Fix the previous panic using alias, with more user friendly error. - Add tests for panic fix. - Make a const for `_id`. - Schema Test to ensure the field we want to alias exists (even though it actually existed from before)
Resolves #1578
Resolves #1551
Part-of: #1279
Description
_id
.For Reviewers
PR(MAIN):
commit needs the most attention.Tasks
How has this been tested?
Integration Tests
Specify the platform(s) on which this was tested: