graphql-engine/v3/crates/query-usage-analytics
Anon Ray 543ffd4727 data shape for query usage analytics (#606)
## Description

The expectation is, that engine should emit usages of OpenDD objects
(i.e. models, commands, relationships, permissions, fields of types
etc.) from a GraphQL query.

This PR adds the types required to gather query usage analytics, under a new crate `query-usage-analytics`.

V3_GIT_ORIGIN_REV_ID: 49778c25a9019e0c8c9a2d13eaa8ba28638b8b55
2024-05-28 09:51:09 +00:00
..
src data shape for query usage analytics (#606) 2024-05-28 09:51:09 +00:00
Cargo.toml data shape for query usage analytics (#606) 2024-05-28 09:51:09 +00:00
README.md data shape for query usage analytics (#606) 2024-05-28 09:51:09 +00:00

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.