mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-16 09:51:59 +03:00
e8ec700d70
This PR introduces the following changes to query usage analytics data shape: - The `name` field in `RelationshipUsage` is just `RelationshipName` without `Qualified` wrapper. The `source` is already qualified, and the same qualification applies to `name`. - The `used` for both field and input field is a list. A field can use multiple opendd objects at a time. - Example: A root field can use `Model` and `Permission` (with both filter and argument presets). - The permission usage now revamped to express available permissions in the opendd - Filter predicate - provides lists of fields and relationships - Field presets - provides a list of fields involved - Argument presets - provides a list of arguments involved - The `GqlFieldArgument` is dropped in favor of `GqlInputField`. - Opendd object usage is not specified for `GqlFieldArgument`. An input argument with object type can have field presets permission. It is replaced with `GqlInputField` to allow specifying the permission usage. This PR also includes JSON schema for the data shape with a golden test to verify. V3_GIT_ORIGIN_REV_ID: f0bf9ba201471af367ef5027bc2c8b9f915994ac |
||
---|---|---|
.. | ||
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.