-
Notifications
You must be signed in to change notification settings - Fork 980
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
Nested Sorting: interface by non-derived child entity #4058
Conversation
Is this ready for review or should I wait until you've done your refactor? |
@lutter wait until refactor, I will @mention you |
1d9d19d
to
4f1adae
Compare
dfc9ca9
to
570c71c
Compare
4b0a0f5
to
1d343e1
Compare
1d343e1
to
7910ff1
Compare
7910ff1
to
78adcbb
Compare
aefeff1
to
e96099f
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.
Looks good to me. I like how you avoided passing that somewhat mysterious boolean flag around.
To me, the most important thing is that this won't change the behavior of queries that work today - I think that is true, and I don't have a great idea how we could test that more rigorously. The existing query tests should ensure that.
This is good to be merged after a rebase, and addressing the comment about making sorting by an interface where the field has mixed storage in implementers an error. I think it would lead to a SQL error anyway, but an explicit error would be clearer.
} | ||
// Finds the field that connects the parent entity with the child entity. | ||
// In the case of an interface, we need to find the field on one of the types that implement the interface, | ||
// as the `@derivedFrom` directive is only allowed on object types. |
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.
The crazy thing here is that AFAIK it's possible for different object types that implement the same interface to store that attribute directly or derived. I have no idea how well that actually works in practice, but I don't think we enforce anything there.
I don't think we should hold this PR up any longer because of that, but it's likely that this will lead to issues if anybody uses that somewhat crazy mix of derived and direct storage. I have no idea if anybody does that, and we should have a look at the specific subgraph if that ever leads to issues. It might be a good idea though to require that all implementers of the interface use the same storage and return an error otherwise just to make sure we don't inadvertently return incorrect data.
c803b11
to
ea762af
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.
Hi
Sorting an interface on a child basis.
Kamil, please fix me :(
use_sort_key_alias
boolean with something