mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 17:31:56 +03:00
d5909e8c48
<!-- The PR description should answer 2 important questions: --> ### What <!-- What is this PR trying to accomplish (and why, if it's not obvious)? --> <!-- Consider: do we need to add a changelog entry? --> <!-- Does this PR introduce new validation that might break old builds? --> <!-- Consider: do we need to put new checks behind a flag? --> Fields involved in the relationship's inner predicates were incorrectly reported as fields of the root model. This PR resolves the issue. Also, fixes the predicates inside `And` or `Or` are not reported. Note: Changelog not required, as query usage analytics are Hasura internal and hidden from users. ### How <!-- How is it trying to accomplish it (what are the implementation steps)? --> - Use `for` loop instead of `Iterator map` to avoid confusion around the execution of lambda passed to the `map` function (more context in this [slack](https://hasurahq.slack.com/archives/C04PUMV4X16/p1722871834852519) thread) - Introduce a new struct, to report predicate relationship fields, that has a field to report its inner filter predicate usage. V3_GIT_ORIGIN_REV_ID: 9ca23e6005ccb09f2321a2ae30ef575f99e84e06 |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
query_usage_analytics.jsonschema | ||
README.md |
Query Usage Analytics
We want to gather usage analytics from a GraphQL query. Usage analytics of models, commands, fields, permissions, relationships etc. being used in the query.
For now, this crate defines the types we would construct for gathering usage analytics. Later, this can also include functions required to build up these types. Ideally, this crate should expose an API which the engine IR generation or query plan generation can use to create a usage analytics type and serialize and emit it.
The types here are a simplified version of the GraphQL query AST, OpenDD and metadata-resolve types.