Add GraphQL query filtering capability #2212
Merged
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.
This PR introduces the ability to add conditions to aggregate queries in the GraphQL API. This allows users to select only public projects or all the builds submitted after a given timestamp, for example. This introductory PR adds the =, !=, <, and > operators. Future PRs will add additional operators to the filter set.
How is this PR different from Lighthouse-PHP's existing filtering functionality? The approach Lighthouse takes is not type safe, which makes the API confusing to use and difficult to maintain. It also lacks the flexibility CDash needs, and does not support enumeration filtering. This PR builds upon Lighthouse's existing approach, by introducing type-safe filters.
In the future, these filters can be improved by restricting the operators available on a per-type basis. For example, it doesn't make sense to perform a less-than operation on an enumeration in most cases, but we still offer the less-than operator.