mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 17:31:56 +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 |
||
---|---|---|
.. | ||
failing | ||
passing | ||
metadata_golden_tests.rs |