-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Filter by child entity #3022
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
Filter by child entity #3022
Conversation
|
@kamilkisiela First off, you should base your work off the What I would do is define a new variant In your example, you want |
|
One downside of what I suggested is that I think either approach would be fine to get started, though this one would be cleaner since it expresses that child filters can only go one level deep cleanly |
51233c8 to
72fb7fd
Compare
f8f1517 to
135a524
Compare
d073da1 to
786e170
Compare
e3e551a to
ad81c2b
Compare
c98485d to
3727335
Compare
ad81c2b to
c288e18
Compare
That makes it possible to use the same schema for data nad for introspection queries
The old name wasn't matching what we use it for any more
No cows were harmed in making this change
That is demanded by the GraphQL spec. We need to have a predictable order to ensure attestations remain stable, though this change breaks attestations since it changes the order in which fields appear in the output from alphabetical (however a `BTreeMap` orders string keys) to the order in which fields appear in a query. It also allows us to replace `BTreeMaps`, which are fairly memory intensive, with cheaper `Vec`. The test changes all reflect the changed output behavior; they only reorder fields in the expected output but do not otherwise alter the tests. Fixes #2943
Rather than use a string name, use the actual object type to identify types. It's not possible to do this with plain references, for example, because we pass a reference to a SelectionSet to graph::spawn_blocking, so we do the next best thing and use an Arc. Unfortunately, because `graphql_parser` doesn't wrap its object types in an Arc, that means we need to keep a copy of all of them in ApiSchema.
This just shuffles some code around, but doesn't change anything else, in preparation for representing the schema in a way that's more useful to us.
Set ENABLE_GRAPHQL_VALIDATIONS to any value in the environment to enable validations, rather than enabling them by default and disabling them on demand
Make sure that we handle queries that have a selection from a scalar field by ignoring the selection or that have no selection for a non-scalar field by ignoring that field. The latter differs from the previous behavior where the result would contain an entry for such a field, but the data for the field would be an empty object or a list of empty objects.
Instead of immediately reporting an error, treat missing variables as nulls and let the rest of the execution logic deal with nulls
c288e18 to
c02173a
Compare
#2960
Given the schema:
The
sender_is added toPurpose_filterinput object.input Purpose_filter { ... + sender_: Sender_filter }The
Sender_filterinput object is untouched.Questions
How should I handle
@derivedFromdirective?I see in code that the
whereargument is not generated for fields with@derivedFrom.Is it find that I hardcoded
cfor root table (the one we select columns from)?I noticed that aliases/prefixes for tables and columns are hard-coded so I guess it's fine to assume that
crepresents the root tabel.Filters can be deeply nested, is it a problem?
The logic behind generating the joins is fairly easy and we won't end up with duplicates. It's table <-> table and it starts from "root" table (the one that we select from).
Every table gets its own prefix/alias, the root table gets
c. In case of a few level deep filter that adds a condition forFooentity, it ends up being prefixed in the same way as the condition forFooin the first or n-th level.Should a left join contain
vid = vidcondition?I used
left jointo join tables withparent.id = child.column AND parent.vid = child.vidcondition. Is it fine? I guess so, becausevidrepresents the version and they should match.