mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-17 12:31:52 +03:00
63ac02bc07
### What In order to more easily monitor and review changes to metadata resolution, this introduces snapshot testing for both successful and failing calls to `resolve`. I used [Insta](https://insta.rs/) for this. ### How For tests of the failure case, we already had a text file with the expected error, so I have turned those files into snapshot files. I wrote a small script to move the files rather than deleting and recreating them so I could guarantee that the contents have not changed. (Unfortunately, Git's diff doesn't always recognise the move as a move because Insta has added a header.) For tests of the successful case, I added a line to snapshot the metadata rather than discarding it. I also rewrote the tests to use `insta::glob` so we could get rid of `test_each`. V3_GIT_ORIGIN_REV_ID: 41bef4cf77bddb8d20d7c101df52ae149e8b0476
47 lines
1.2 KiB
Plaintext
47 lines
1.2 KiB
Plaintext
---
|
|
source: crates/metadata-resolve/tests/metadata_golden_tests.rs
|
|
expression: resolved
|
|
input_file: crates/metadata-resolve/tests/passing/subgraph_valid_name/metadata.json
|
|
---
|
|
Metadata {
|
|
object_types: {},
|
|
scalar_types: {},
|
|
models: {},
|
|
commands: {},
|
|
object_boolean_expression_types: {},
|
|
boolean_expression_types: BooleanExpressionTypes {
|
|
objects: {},
|
|
scalars: {},
|
|
},
|
|
aggregate_expressions: {},
|
|
graphql_config: GlobalGraphqlConfig {
|
|
query_root_type_name: TypeName(
|
|
Name(
|
|
"Query",
|
|
),
|
|
),
|
|
mutation_root_type_name: TypeName(
|
|
Name(
|
|
"Mutation",
|
|
),
|
|
),
|
|
order_by_input: Some(
|
|
OrderByInputGraphqlConfig {
|
|
asc_direction_field_value: Name(
|
|
"Asc",
|
|
),
|
|
desc_direction_field_value: Name(
|
|
"Desc",
|
|
),
|
|
enum_type_name: TypeName(
|
|
Name(
|
|
"order_by",
|
|
),
|
|
),
|
|
},
|
|
),
|
|
enable_apollo_federation_fields: false,
|
|
},
|
|
roles: [],
|
|
}
|