mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-16 01:44:03 +03:00
e44589931c
This PR replaces most of the string newtypes in the open-dds crate with new implementations based on `SmolStr`, using a macro adapted from the macro used in ndc-models. `SmolStr` usage should result in less heap allocations and the macro ensures all the newtypes get all the same trait implementations (such as various `From` and `Borrow` instances) and helper impl functions (such as `as_str`). The new macro, `str_newtype`, creates a newtype wrapper around `SmolStr` or another type (typically `Identifier`), and writes out all the various trait implementations. It also takes a documentation string which ensures that every newtype has a description in JSON Schema. The changes in the downstream crates are just adjusting to use the new newtypes. Also: * `QueryGraphqlConfig` used a lot of String typed-properties; these have been changed for the appropriate `GraphQlTypeName` and `GraphQlFieldName` types. * metadata-resolve had a duplicate newtype called `ConnectorArgumentName`, which duplicated open-dds's `DataConnectorArgumentName`. This has been removed and replaced. * A new newtype called `CollectionName` has been added in open-dds to represent the name of the ndc collection that a model points to. This was previously just a string. V3_GIT_ORIGIN_REV_ID: d5a33756ef0e110b2255478358a38e42e6ff89a2 |
||
---|---|---|
.. | ||
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.