diff --git a/arion-compose/e2e-testing.nix b/arion-compose/e2e-testing.nix index ee562b1b..80254f93 100644 --- a/arion-compose/e2e-testing.nix +++ b/arion-compose/e2e-testing.nix @@ -20,7 +20,7 @@ in connector = import ./services/connector.nix { inherit pkgs; - configuration-dir = ../fixtures/hasura/chinook/connector; + configuration-dir = ../fixtures/hasura/app/connector/chinook; database-uri = "mongodb://mongodb/chinook"; port = connector-port; service.depends_on.mongodb.condition = "service_healthy"; @@ -38,7 +38,7 @@ in inherit pkgs; port = engine-port; connectors.chinook = "http://connector:${connector-port}"; - ddn-dirs = [ ../fixtures/hasura/chinook/metadata ]; + ddn-dirs = [ ../fixtures/hasura/app/metadata ]; service.depends_on = { auth-hook.condition = "service_started"; }; diff --git a/arion-compose/integration-test-services.nix b/arion-compose/integration-test-services.nix index 1b7fd813..a1fd50a8 100644 --- a/arion-compose/integration-test-services.nix +++ b/arion-compose/integration-test-services.nix @@ -22,7 +22,7 @@ in { connector = import ./services/connector.nix { inherit pkgs otlp-endpoint; - configuration-dir = ../fixtures/hasura/sample_mflix/connector; + configuration-dir = ../fixtures/hasura/app/connector/sample_mflix; database-uri = "mongodb://mongodb/sample_mflix"; port = connector-port; hostPort = hostPort connector-port; @@ -33,7 +33,7 @@ in connector-chinook = import ./services/connector.nix { inherit pkgs otlp-endpoint; - configuration-dir = ../fixtures/hasura/chinook/connector; + configuration-dir = ../fixtures/hasura/app/connector/chinook; database-uri = "mongodb://mongodb/chinook"; port = connector-chinook-port; hostPort = hostPort connector-chinook-port; @@ -44,7 +44,7 @@ in connector-test-cases = import ./services/connector.nix { inherit pkgs otlp-endpoint; - configuration-dir = ../fixtures/hasura/test_cases/connector; + configuration-dir = ../fixtures/hasura/app/connector/test_cases; database-uri = "mongodb://mongodb/test_cases"; port = connector-test-cases-port; hostPort = hostPort connector-test-cases-port; @@ -75,10 +75,7 @@ in test_cases = "http://connector-test-cases:${connector-test-cases-port}"; }; ddn-dirs = [ - ../fixtures/hasura/chinook/metadata - ../fixtures/hasura/sample_mflix/metadata - ../fixtures/hasura/test_cases/metadata - ../fixtures/hasura/common/metadata + ../fixtures/hasura/app/metadata ]; service.depends_on = { auth-hook.condition = "service_started"; diff --git a/arion-compose/ndc-test.nix b/arion-compose/ndc-test.nix index 9af28502..12daabc1 100644 --- a/arion-compose/ndc-test.nix +++ b/arion-compose/ndc-test.nix @@ -14,7 +14,7 @@ in # command = ["test" "--snapshots-dir" "/snapshots" "--seed" "1337_1337_1337_1337_1337_1337_13"]; # Replay and test the recorded snapshots # command = ["replay" "--snapshots-dir" "/snapshots"]; - configuration-dir = ../fixtures/hasura/chinook/connector; + configuration-dir = ../fixtures/hasura/app/connector/chinook; database-uri = "mongodb://mongodb:${mongodb-port}/chinook"; service.depends_on.mongodb.condition = "service_healthy"; # Run the container as the current user so when it writes to the snapshots directory it doesn't write as root diff --git a/arion-compose/services/connector.nix b/arion-compose/services/connector.nix index abca3c00..ed820931 100644 --- a/arion-compose/services/connector.nix +++ b/arion-compose/services/connector.nix @@ -12,7 +12,7 @@ , profile ? "dev" # Rust crate profile, usually either "dev" or "release" , hostPort ? null , command ? ["serve"] -, configuration-dir ? ../../fixtures/hasura/sample_mflix/connector +, configuration-dir ? ../../fixtures/hasura/app/connector/sample_mflix , database-uri ? "mongodb://mongodb/sample_mflix" , service ? { } # additional options to customize this service configuration , otlp-endpoint ? null diff --git a/arion-compose/services/engine.nix b/arion-compose/services/engine.nix index 4050e0a1..1d30bc2f 100644 --- a/arion-compose/services/engine.nix +++ b/arion-compose/services/engine.nix @@ -6,7 +6,7 @@ # a `DataConnectorLink.definition.name` value in one of the given `ddn-dirs` # to correctly match up configuration to connector instances. , connectors ? { sample_mflix = "http://connector:7130"; } -, ddn-dirs ? [ ../../fixtures/hasura/sample_mflix/metadata ] +, ddn-dirs ? [ ../../fixtures/hasura/app/metadata ] , auth-webhook ? { url = "http://auth-hook:3050/validate-request"; } , otlp-endpoint ? "http://jaeger:4317" , service ? { } # additional options to customize this service configuration diff --git a/crates/cli/src/introspection/validation_schema.rs b/crates/cli/src/introspection/validation_schema.rs index a21a6fc0..507355e3 100644 --- a/crates/cli/src/introspection/validation_schema.rs +++ b/crates/cli/src/introspection/validation_schema.rs @@ -37,7 +37,11 @@ pub async fn get_metadata_from_validation_schema( if let Some(schema_bson) = schema_bson_option { let validator_schema = from_bson::(schema_bson.clone()).map_err(|err| { - MongoAgentError::BadCollectionSchema(name.to_owned(), schema_bson.clone(), err) + MongoAgentError::BadCollectionSchema(Box::new(( + name.to_owned(), + schema_bson.clone(), + err, + ))) })?; let collection_schema = make_collection_schema(name, &validator_schema); schemas.push(collection_schema); diff --git a/crates/configuration/src/with_name.rs b/crates/configuration/src/with_name.rs index 85afbfdd..2dd44ba1 100644 --- a/crates/configuration/src/with_name.rs +++ b/crates/configuration/src/with_name.rs @@ -56,7 +56,7 @@ pub struct WithNameRef<'a, N, T> { pub value: &'a T, } -impl<'a, N, T> WithNameRef<'a, N, T> { +impl WithNameRef<'_, N, T> { pub fn named<'b>(name: &'b N, value: &'b T) -> WithNameRef<'b, N, T> { WithNameRef { name, value } } diff --git a/crates/integration-tests/src/tests/aggregation.rs b/crates/integration-tests/src/tests/aggregation.rs index 6b35a1b3..afa2fbdd 100644 --- a/crates/integration-tests/src/tests/aggregation.rs +++ b/crates/integration-tests/src/tests/aggregation.rs @@ -18,10 +18,10 @@ async fn runs_aggregation_over_top_level_fields() -> anyhow::Result<()> { ) { _count milliseconds { - _avg - _max - _min - _sum + avg + max + min + sum } unitPrice { _count @@ -48,11 +48,11 @@ async fn aggregates_extended_json_representing_mixture_of_numeric_types() -> any filter_input: { where: { type: { _regex: $types } } } ) { value { - _avg + avg _count - _max - _min - _sum + max + min + sum _count_distinct } } @@ -80,11 +80,11 @@ async fn aggregates_mixture_of_numeric_and_null_values() -> anyhow::Result<()> { filter_input: { where: { type: { _regex: $types } } } ) { value { - _avg + avg _count - _max - _min - _sum + max + min + sum _count_distinct } } diff --git a/crates/integration-tests/src/tests/basic.rs b/crates/integration-tests/src/tests/basic.rs index a625f4b8..41cb23ca 100644 --- a/crates/integration-tests/src/tests/basic.rs +++ b/crates/integration-tests/src/tests/basic.rs @@ -77,7 +77,7 @@ async fn selects_field_names_that_require_escaping() -> anyhow::Result<()> { graphql_query( r#" query { - testCases_weirdFieldNames(limit: 1, order_by: { invalidName: Asc }) { + weirdFieldNames(limit: 1, order_by: { invalidName: Asc }) { invalidName invalidObjectName { validName @@ -101,7 +101,7 @@ async fn selects_nested_field_with_dollar_sign_in_name() -> anyhow::Result<()> { graphql_query( r#" query { - testCases_nestedFieldWithDollar(order_by: { configuration: Asc }) { + nestedFieldWithDollar(order_by: { configuration: Asc }) { configuration { schema } diff --git a/crates/integration-tests/src/tests/expressions.rs b/crates/integration-tests/src/tests/expressions.rs index 9b59046c..ff527bd3 100644 --- a/crates/integration-tests/src/tests/expressions.rs +++ b/crates/integration-tests/src/tests/expressions.rs @@ -13,7 +13,7 @@ async fn evaluates_field_name_that_requires_escaping() -> anyhow::Result<()> { graphql_query( r#" query { - testCases_weirdFieldNames(where: { invalidName: { _eq: 3 } }) { + weirdFieldNames(where: { invalidName: { _eq: 3 } }) { invalidName } } @@ -31,7 +31,7 @@ async fn evaluates_field_name_that_requires_escaping_in_complex_expression() -> graphql_query( r#" query { - testCases_weirdFieldNames( + weirdFieldNames( where: { _and: [ { invalidName: { _gt: 2 } }, diff --git a/crates/integration-tests/src/tests/filtering.rs b/crates/integration-tests/src/tests/filtering.rs index 310300ee..d0f68a68 100644 --- a/crates/integration-tests/src/tests/filtering.rs +++ b/crates/integration-tests/src/tests/filtering.rs @@ -51,7 +51,7 @@ async fn filters_by_comparisons_on_elements_of_array_field() -> anyhow::Result<( graphql_query( r#" query { - testCases_nestedCollection( + nestedCollection( where: { staff: { name: { _eq: "Freeman" } } } order_by: { institution: Asc } ) { @@ -66,25 +66,6 @@ async fn filters_by_comparisons_on_elements_of_array_field() -> anyhow::Result<( Ok(()) } -#[tokio::test] -async fn filters_by_comparisons_on_elements_of_array_of_scalars() -> anyhow::Result<()> { - assert_yaml_snapshot!( - graphql_query( - r#" - query MyQuery { - movies(where: { cast: { _eq: "Albert Austin" } }) { - title - cast - } - } - "# - ) - .run() - .await? - ); - Ok(()) -} - #[tokio::test] async fn filters_by_comparisons_on_elements_of_array_of_scalars_against_variable( ) -> anyhow::Result<()> { diff --git a/crates/integration-tests/src/tests/native_mutation.rs b/crates/integration-tests/src/tests/native_mutation.rs index 2dea14ac..b5a0c58e 100644 --- a/crates/integration-tests/src/tests/native_mutation.rs +++ b/crates/integration-tests/src/tests/native_mutation.rs @@ -66,7 +66,7 @@ async fn accepts_predicate_argument() -> anyhow::Result<()> { let mutation_resp = graphql_query( r#" mutation($albumId: Int!) { - chinook_updateTrackPrices(newPrice: "11.99", where: {albumId: {_eq: $albumId}}) { + updateTrackPrices(newPrice: "11.99", where: {albumId: {_eq: $albumId}}) { n ok } @@ -79,7 +79,7 @@ async fn accepts_predicate_argument() -> anyhow::Result<()> { assert_eq!(mutation_resp.errors, None); assert_json!(mutation_resp.data, { - "chinook_updateTrackPrices": { + "updateTrackPrices": { "ok": 1.0, "n": validators::i64(|n| if n > &0 { Ok(()) diff --git a/crates/integration-tests/src/tests/native_query.rs b/crates/integration-tests/src/tests/native_query.rs index 59e436f7..6865b5fe 100644 --- a/crates/integration-tests/src/tests/native_query.rs +++ b/crates/integration-tests/src/tests/native_query.rs @@ -24,13 +24,13 @@ async fn runs_native_query_with_collection_representation() -> anyhow::Result<() graphql_query( r#" query { - title_word_frequencies( + titleWordFrequency( where: {count: {_eq: 2}} - order_by: {word: Asc} + order_by: {id: Asc} offset: 100 limit: 25 ) { - word + id count } } diff --git a/crates/integration-tests/src/tests/snapshots/integration_tests__tests__aggregation__aggregates_extended_json_representing_mixture_of_numeric_types.snap b/crates/integration-tests/src/tests/snapshots/integration_tests__tests__aggregation__aggregates_extended_json_representing_mixture_of_numeric_types.snap index 8cac9767..c4a039c5 100644 --- a/crates/integration-tests/src/tests/snapshots/integration_tests__tests__aggregation__aggregates_extended_json_representing_mixture_of_numeric_types.snap +++ b/crates/integration-tests/src/tests/snapshots/integration_tests__tests__aggregation__aggregates_extended_json_representing_mixture_of_numeric_types.snap @@ -1,18 +1,18 @@ --- source: crates/integration-tests/src/tests/aggregation.rs -expression: "graphql_query(r#\"\n query ($types: String!) {\n extendedJsonTestDataAggregate(\n filter_input: { where: { type: { _regex: $types } } }\n ) {\n value {\n _avg\n _count\n _max\n _min\n _sum\n _count_distinct\n }\n }\n extendedJsonTestData(where: { type: { _regex: $types } }) {\n type\n value\n }\n }\n \"#).variables(json!({\n \"types\": \"decimal|double|int|long\"\n })).run().await?" +expression: "graphql_query(r#\"\n query ($types: String!) {\n extendedJsonTestDataAggregate(\n filter_input: { where: { type: { _regex: $types } } }\n ) {\n value {\n avg\n _count\n max\n min\n sum\n _count_distinct\n }\n }\n extendedJsonTestData(where: { type: { _regex: $types } }) {\n type\n value\n }\n }\n \"#).variables(json!({\n \"types\": \"decimal|double|int|long\"\n})).run().await?" --- data: extendedJsonTestDataAggregate: value: - _avg: + avg: $numberDecimal: "4.5" _count: 8 - _max: + max: $numberLong: "8" - _min: + min: $numberDecimal: "1" - _sum: + sum: $numberDecimal: "36" _count_distinct: 8 extendedJsonTestData: diff --git a/crates/integration-tests/src/tests/snapshots/integration_tests__tests__aggregation__aggregates_mixture_of_numeric_and_null_values.snap b/crates/integration-tests/src/tests/snapshots/integration_tests__tests__aggregation__aggregates_mixture_of_numeric_and_null_values.snap index 1a498f8b..e54279e9 100644 --- a/crates/integration-tests/src/tests/snapshots/integration_tests__tests__aggregation__aggregates_mixture_of_numeric_and_null_values.snap +++ b/crates/integration-tests/src/tests/snapshots/integration_tests__tests__aggregation__aggregates_mixture_of_numeric_and_null_values.snap @@ -1,18 +1,18 @@ --- source: crates/integration-tests/src/tests/aggregation.rs -expression: "graphql_query(r#\"\n query ($types: String!) {\n extendedJsonTestDataAggregate(\n filter_input: { where: { type: { _regex: $types } } }\n ) {\n value {\n _avg\n _count\n _max\n _min\n _sum\n _count_distinct\n }\n }\n extendedJsonTestData(where: { type: { _regex: $types } }) {\n type\n value\n }\n }\n \"#).variables(json!({\n \"types\": \"double|null\"\n })).run().await?" +expression: "graphql_query(r#\"\n query ($types: String!) {\n extendedJsonTestDataAggregate(\n filter_input: { where: { type: { _regex: $types } } }\n ) {\n value {\n avg\n _count\n max\n min\n sum\n _count_distinct\n }\n }\n extendedJsonTestData(where: { type: { _regex: $types } }) {\n type\n value\n }\n }\n \"#).variables(json!({\n \"types\": \"double|null\"\n})).run().await?" --- data: extendedJsonTestDataAggregate: value: - _avg: + avg: $numberDouble: "3.5" _count: 2 - _max: + max: $numberDouble: "4.0" - _min: + min: $numberDouble: "3.0" - _sum: + sum: $numberDouble: "7.0" _count_distinct: 2 extendedJsonTestData: diff --git a/crates/integration-tests/src/tests/snapshots/integration_tests__tests__aggregation__runs_aggregation_over_top_level_fields.snap b/crates/integration-tests/src/tests/snapshots/integration_tests__tests__aggregation__runs_aggregation_over_top_level_fields.snap index 609c9931..b3a603b1 100644 --- a/crates/integration-tests/src/tests/snapshots/integration_tests__tests__aggregation__runs_aggregation_over_top_level_fields.snap +++ b/crates/integration-tests/src/tests/snapshots/integration_tests__tests__aggregation__runs_aggregation_over_top_level_fields.snap @@ -1,6 +1,6 @@ --- source: crates/integration-tests/src/tests/aggregation.rs -expression: "graphql_query(r#\"\n query($albumId: Int!) {\n track(order_by: { id: Asc }, where: { albumId: { _eq: $albumId } }) {\n milliseconds\n unitPrice\n }\n trackAggregate(\n filter_input: { order_by: { id: Asc }, where: { albumId: { _eq: $albumId } } }\n ) {\n _count\n milliseconds {\n _avg\n _max\n _min\n _sum\n }\n unitPrice {\n _count\n _count_distinct\n }\n }\n }\n \"#).variables(json!({\n \"albumId\": 9\n })).run().await?" +expression: "graphql_query(r#\"\n query($albumId: Int!) {\n track(order_by: { id: Asc }, where: { albumId: { _eq: $albumId } }) {\n milliseconds\n unitPrice\n }\n trackAggregate(\n filter_input: { order_by: { id: Asc }, where: { albumId: { _eq: $albumId } } }\n ) {\n _count\n milliseconds {\n avg\n max\n min\n sum\n }\n unitPrice {\n _count\n _count_distinct\n }\n }\n }\n \"#).variables(json!({\n \"albumId\": 9\n})).run().await?" --- data: track: @@ -23,10 +23,10 @@ data: trackAggregate: _count: 8 milliseconds: - _avg: 333925.875 - _max: 436453 - _min: 221701 - _sum: 2671407 + avg: 333925.875 + max: 436453 + min: 221701 + sum: 2671407 unitPrice: _count: 8 _count_distinct: 1 diff --git a/crates/integration-tests/src/tests/snapshots/integration_tests__tests__basic__selects_field_names_that_require_escaping.snap b/crates/integration-tests/src/tests/snapshots/integration_tests__tests__basic__selects_field_names_that_require_escaping.snap index 68caca9d..cb341577 100644 --- a/crates/integration-tests/src/tests/snapshots/integration_tests__tests__basic__selects_field_names_that_require_escaping.snap +++ b/crates/integration-tests/src/tests/snapshots/integration_tests__tests__basic__selects_field_names_that_require_escaping.snap @@ -1,9 +1,9 @@ --- source: crates/integration-tests/src/tests/basic.rs -expression: "graphql_query(r#\"\n query {\n testCases_weirdFieldNames(limit: 1, order_by: { invalidName: Asc }) {\n invalidName\n invalidObjectName {\n validName\n }\n validObjectName {\n invalidNestedName\n }\n }\n }\n \"#).run().await?" +expression: "graphql_query(r#\"\n query {\n weirdFieldNames(limit: 1, order_by: { invalidName: Asc }) {\n invalidName\n invalidObjectName {\n validName\n }\n validObjectName {\n invalidNestedName\n }\n }\n }\n \"#).run().await?" --- data: - testCases_weirdFieldNames: + weirdFieldNames: - invalidName: 1 invalidObjectName: validName: 1 diff --git a/crates/integration-tests/src/tests/snapshots/integration_tests__tests__basic__selects_nested_field_with_dollar_sign_in_name.snap b/crates/integration-tests/src/tests/snapshots/integration_tests__tests__basic__selects_nested_field_with_dollar_sign_in_name.snap index 46bc597a..656a6dc3 100644 --- a/crates/integration-tests/src/tests/snapshots/integration_tests__tests__basic__selects_nested_field_with_dollar_sign_in_name.snap +++ b/crates/integration-tests/src/tests/snapshots/integration_tests__tests__basic__selects_nested_field_with_dollar_sign_in_name.snap @@ -1,9 +1,9 @@ --- source: crates/integration-tests/src/tests/basic.rs -expression: "graphql_query(r#\"\n query {\n testCases_nestedFieldWithDollar(order_by: { configuration: Asc }) {\n configuration {\n schema\n }\n }\n }\n \"#).run().await?" +expression: "graphql_query(r#\"\n query {\n nestedFieldWithDollar(order_by: { configuration: Asc }) {\n configuration {\n schema\n }\n }\n }\n \"#).run().await?" --- data: - testCases_nestedFieldWithDollar: + nestedFieldWithDollar: - configuration: schema: ~ - configuration: diff --git a/crates/integration-tests/src/tests/snapshots/integration_tests__tests__expressions__evaluates_field_name_that_requires_escaping.snap b/crates/integration-tests/src/tests/snapshots/integration_tests__tests__expressions__evaluates_field_name_that_requires_escaping.snap index 0259aa59..fc9f6e18 100644 --- a/crates/integration-tests/src/tests/snapshots/integration_tests__tests__expressions__evaluates_field_name_that_requires_escaping.snap +++ b/crates/integration-tests/src/tests/snapshots/integration_tests__tests__expressions__evaluates_field_name_that_requires_escaping.snap @@ -1,8 +1,8 @@ --- source: crates/integration-tests/src/tests/expressions.rs -expression: "graphql_query(r#\"\n query {\n testCases_weirdFieldNames(where: { invalidName: { _eq: 3 } }) {\n invalidName\n }\n }\n \"#).run().await?" +expression: "graphql_query(r#\"\n query {\n weirdFieldNames(where: { invalidName: { _eq: 3 } }) {\n invalidName\n }\n }\n \"#).run().await?" --- data: - testCases_weirdFieldNames: + weirdFieldNames: - invalidName: 3 errors: ~ diff --git a/crates/integration-tests/src/tests/snapshots/integration_tests__tests__expressions__evaluates_field_name_that_requires_escaping_in_complex_expression.snap b/crates/integration-tests/src/tests/snapshots/integration_tests__tests__expressions__evaluates_field_name_that_requires_escaping_in_complex_expression.snap index cdd1cbcc..db551750 100644 --- a/crates/integration-tests/src/tests/snapshots/integration_tests__tests__expressions__evaluates_field_name_that_requires_escaping_in_complex_expression.snap +++ b/crates/integration-tests/src/tests/snapshots/integration_tests__tests__expressions__evaluates_field_name_that_requires_escaping_in_complex_expression.snap @@ -1,8 +1,8 @@ --- source: crates/integration-tests/src/tests/expressions.rs -expression: "graphql_query(r#\"\n query {\n testCases_weirdFieldNames(\n where: { \n _and: [\n { invalidName: { _gt: 2 } },\n { invalidName: { _lt: 4 } } \n ] \n }\n ) {\n invalidName\n }\n }\n \"#).run().await?" +expression: "graphql_query(r#\"\n query {\n weirdFieldNames(\n where: { \n _and: [\n { invalidName: { _gt: 2 } },\n { invalidName: { _lt: 4 } } \n ] \n }\n ) {\n invalidName\n }\n }\n \"#).run().await?" --- data: - testCases_weirdFieldNames: + weirdFieldNames: - invalidName: 3 errors: ~ diff --git a/crates/integration-tests/src/tests/snapshots/integration_tests__tests__filtering__filters_by_comparisons_on_elements_of_array_field.snap b/crates/integration-tests/src/tests/snapshots/integration_tests__tests__filtering__filters_by_comparisons_on_elements_of_array_field.snap index 37db004b..32120675 100644 --- a/crates/integration-tests/src/tests/snapshots/integration_tests__tests__filtering__filters_by_comparisons_on_elements_of_array_field.snap +++ b/crates/integration-tests/src/tests/snapshots/integration_tests__tests__filtering__filters_by_comparisons_on_elements_of_array_field.snap @@ -1,9 +1,9 @@ --- source: crates/integration-tests/src/tests/filtering.rs -expression: "graphql_query(r#\"\n query {\n testCases_nestedCollection(\n where: { staff: { name: { _eq: \"Freeman\" } } }\n order_by: { institution: Asc }\n ) {\n institution\n }\n }\n \"#).run().await?" +expression: "graphql_query(r#\"\n query {\n nestedCollection(\n where: { staff: { name: { _eq: \"Freeman\" } } }\n order_by: { institution: Asc }\n ) {\n institution\n }\n }\n \"#).run().await?" --- data: - testCases_nestedCollection: + nestedCollection: - institution: Black Mesa - institution: City 17 errors: ~ diff --git a/crates/integration-tests/src/tests/snapshots/integration_tests__tests__native_query__runs_native_query_with_collection_representation.snap b/crates/integration-tests/src/tests/snapshots/integration_tests__tests__native_query__runs_native_query_with_collection_representation.snap index c2d65132..f4e11e24 100644 --- a/crates/integration-tests/src/tests/snapshots/integration_tests__tests__native_query__runs_native_query_with_collection_representation.snap +++ b/crates/integration-tests/src/tests/snapshots/integration_tests__tests__native_query__runs_native_query_with_collection_representation.snap @@ -1,57 +1,57 @@ --- source: crates/integration-tests/src/tests/native_query.rs -expression: "graphql_query(r#\"\n query {\n title_word_frequencies(\n where: {count: {_eq: 2}}\n order_by: {word: Asc}\n offset: 100\n limit: 25\n ) {\n word\n count\n }\n }\n \"#).run().await?" +expression: "graphql_query(r#\"\n query {\n titleWordFrequency(\n where: {count: {_eq: 2}}\n order_by: {id: Asc}\n offset: 100\n limit: 25\n ) {\n id\n count\n }\n }\n \"#).run().await?" --- data: - title_word_frequencies: - - word: Amish + titleWordFrequency: + - id: Amish count: 2 - - word: Amor? + - id: Amor? count: 2 - - word: Anara + - id: Anara count: 2 - - word: Anarchy + - id: Anarchy count: 2 - - word: Anastasia + - id: Anastasia count: 2 - - word: Anchorman + - id: Anchorman count: 2 - - word: Andre + - id: Andre count: 2 - - word: Andrei + - id: Andrei count: 2 - - word: Andromeda + - id: Andromeda count: 2 - - word: Andrè + - id: Andrè count: 2 - - word: Angela + - id: Angela count: 2 - - word: Angelica + - id: Angelica count: 2 - - word: "Angels'" + - id: "Angels'" count: 2 - - word: "Angels:" + - id: "Angels:" count: 2 - - word: Angst + - id: Angst count: 2 - - word: Animation + - id: Animation count: 2 - - word: Annabelle + - id: Annabelle count: 2 - - word: Anonyma + - id: Anonyma count: 2 - - word: Anonymous + - id: Anonymous count: 2 - - word: Answer + - id: Answer count: 2 - - word: Ant + - id: Ant count: 2 - - word: Antarctic + - id: Antarctic count: 2 - - word: Antoinette + - id: Antoinette count: 2 - - word: Anybody + - id: Anybody count: 2 - - word: Anywhere + - id: Anywhere count: 2 errors: ~ diff --git a/crates/integration-tests/src/tests/snapshots/integration_tests__tests__sorting__sorts_on_nested_field_names_that_require_escaping.snap b/crates/integration-tests/src/tests/snapshots/integration_tests__tests__sorting__sorts_on_nested_field_names_that_require_escaping.snap index 87fede3a..701ccfdb 100644 --- a/crates/integration-tests/src/tests/snapshots/integration_tests__tests__sorting__sorts_on_nested_field_names_that_require_escaping.snap +++ b/crates/integration-tests/src/tests/snapshots/integration_tests__tests__sorting__sorts_on_nested_field_names_that_require_escaping.snap @@ -1,9 +1,9 @@ --- source: crates/integration-tests/src/tests/sorting.rs -expression: "graphql_query(r#\"\n query {\n testCases_weirdFieldNames(limit: 1, order_by: { invalidName: Asc }) {\n invalidName\n invalidObjectName {\n validName\n }\n validObjectName {\n invalidNestedName\n }\n }\n }\n \"#).run().await?" +expression: "graphql_query(r#\"\n query {\n weirdFieldNames(limit: 1, order_by: { invalidName: Asc }) {\n invalidName\n invalidObjectName {\n validName\n }\n validObjectName {\n invalidNestedName\n }\n }\n }\n \"#).run().await?" --- data: - testCases_weirdFieldNames: + weirdFieldNames: - invalidName: 1 invalidObjectName: validName: 1 diff --git a/crates/integration-tests/src/tests/sorting.rs b/crates/integration-tests/src/tests/sorting.rs index 30914b88..35d65283 100644 --- a/crates/integration-tests/src/tests/sorting.rs +++ b/crates/integration-tests/src/tests/sorting.rs @@ -27,7 +27,7 @@ async fn sorts_on_nested_field_names_that_require_escaping() -> anyhow::Result<( graphql_query( r#" query { - testCases_weirdFieldNames(limit: 1, order_by: { invalidName: Asc }) { + weirdFieldNames(limit: 1, order_by: { invalidName: Asc }) { invalidName invalidObjectName { validName diff --git a/crates/mongodb-agent-common/src/interface_types/mongo_agent_error.rs b/crates/mongodb-agent-common/src/interface_types/mongo_agent_error.rs index 97fb6e8e..fe285960 100644 --- a/crates/mongodb-agent-common/src/interface_types/mongo_agent_error.rs +++ b/crates/mongodb-agent-common/src/interface_types/mongo_agent_error.rs @@ -14,7 +14,7 @@ use crate::{procedure::ProcedureError, query::QueryResponseError}; /// agent. #[derive(Debug, Error)] pub enum MongoAgentError { - BadCollectionSchema(String, bson::Bson, bson::de::Error), + BadCollectionSchema(Box<(String, bson::Bson, bson::de::Error)>), // boxed to avoid an excessively-large stack value BadQuery(anyhow::Error), InvalidVariableName(String), InvalidScalarTypeName(String), @@ -37,31 +37,34 @@ use MongoAgentError::*; impl MongoAgentError { pub fn status_and_error_response(&self) -> (StatusCode, ErrorResponse) { match self { - BadCollectionSchema(collection_name, schema, err) => ( - StatusCode::INTERNAL_SERVER_ERROR, - ErrorResponse { - message: format!("Could not parse a collection validator: {err}"), - details: Some( - [ - ( - "collection_name".to_owned(), - serde_json::Value::String(collection_name.clone()), - ), - ( - "collection_validator".to_owned(), - bson::from_bson::(schema.clone()) - .unwrap_or_else(|err| { - serde_json::Value::String(format!( - "Failed to convert bson validator to json: {err}" - )) - }), - ), - ] - .into(), - ), - r#type: None, - }, - ), + BadCollectionSchema(boxed_details) => { + let (collection_name, schema, err) = &**boxed_details; + ( + StatusCode::INTERNAL_SERVER_ERROR, + ErrorResponse { + message: format!("Could not parse a collection validator: {err}"), + details: Some( + [ + ( + "collection_name".to_owned(), + serde_json::Value::String(collection_name.clone()), + ), + ( + "collection_validator".to_owned(), + bson::from_bson::(schema.clone()) + .unwrap_or_else(|err| { + serde_json::Value::String(format!( + "Failed to convert bson validator to json: {err}" + )) + }), + ), + ] + .into(), + ), + r#type: None, + }, + ) + }, BadQuery(err) => (StatusCode::BAD_REQUEST, ErrorResponse::new(&err)), InvalidVariableName(name) => ( StatusCode::BAD_REQUEST, diff --git a/fixtures/hasura/.devcontainer/devcontainer.json b/fixtures/hasura/.devcontainer/devcontainer.json index ea38082b..7ad51800 100644 --- a/fixtures/hasura/.devcontainer/devcontainer.json +++ b/fixtures/hasura/.devcontainer/devcontainer.json @@ -13,5 +13,5 @@ } }, "name": "Hasura DDN Codespace", - "postCreateCommand": "curl -L https://graphql-engine-cdn.hasura.io/ddn/cli/v2/get.sh | bash" + "postCreateCommand": "curl -L https://graphql-engine-cdn.hasura.io/ddn/cli/v4/get.sh | bash" } diff --git a/fixtures/hasura/.env b/fixtures/hasura/.env new file mode 100644 index 00000000..05da391c --- /dev/null +++ b/fixtures/hasura/.env @@ -0,0 +1,15 @@ +APP_SAMPLE_MFLIX_MONGODB_DATABASE_URI="mongodb://local.hasura.dev/sample_mflix" +APP_SAMPLE_MFLIX_OTEL_EXPORTER_OTLP_ENDPOINT="http://local.hasura.dev:4317" +APP_SAMPLE_MFLIX_OTEL_SERVICE_NAME="app_sample_mflix" +APP_SAMPLE_MFLIX_READ_URL="http://local.hasura.dev:7130" +APP_SAMPLE_MFLIX_WRITE_URL="http://local.hasura.dev:7130" +APP_CHINOOK_MONGODB_DATABASE_URI="mongodb://local.hasura.dev/chinook" +APP_CHINOOK_OTEL_EXPORTER_OTLP_ENDPOINT="http://local.hasura.dev:4317" +APP_CHINOOK_OTEL_SERVICE_NAME="app_chinook" +APP_CHINOOK_READ_URL="http://local.hasura.dev:7131" +APP_CHINOOK_WRITE_URL="http://local.hasura.dev:7131" +APP_TEST_CASES_MONGODB_DATABASE_URI="mongodb://local.hasura.dev/test_cases" +APP_TEST_CASES_OTEL_EXPORTER_OTLP_ENDPOINT="http://local.hasura.dev:4317" +APP_TEST_CASES_OTEL_SERVICE_NAME="app_test_cases" +APP_TEST_CASES_READ_URL="http://local.hasura.dev:7132" +APP_TEST_CASES_WRITE_URL="http://local.hasura.dev:7132" diff --git a/fixtures/hasura/.gitattributes b/fixtures/hasura/.gitattributes new file mode 100644 index 00000000..8ddc99f4 --- /dev/null +++ b/fixtures/hasura/.gitattributes @@ -0,0 +1 @@ +*.hml linguist-language=yaml \ No newline at end of file diff --git a/fixtures/hasura/.gitignore b/fixtures/hasura/.gitignore new file mode 100644 index 00000000..d168928d --- /dev/null +++ b/fixtures/hasura/.gitignore @@ -0,0 +1,2 @@ +engine/build +/.env.* diff --git a/fixtures/hasura/.hasura/context.yaml b/fixtures/hasura/.hasura/context.yaml index b23b1ec5..3822ed0e 100644 --- a/fixtures/hasura/.hasura/context.yaml +++ b/fixtures/hasura/.hasura/context.yaml @@ -1,2 +1,14 @@ -context: - supergraph: ../supergraph.yaml +kind: Context +version: v3 +definition: + current: default + contexts: + default: + supergraph: ../supergraph.yaml + subgraph: ../app/subgraph.yaml + localEnvFile: ../.env + scripts: + docker-start: + bash: HASURA_DDN_PAT=$(ddn auth print-pat) PROMPTQL_SECRET_KEY=$(ddn auth print-promptql-secret-key) docker compose -f compose.yaml --env-file .env up --build --pull always + powershell: $Env:HASURA_DDN_PAT = ddn auth print-pat; $Env:PROMPTQL_SECRET_KEY = ddn auth print-promptql-secret-key; docker compose -f compose.yaml --env-file .env up --build --pull always + promptQL: false diff --git a/fixtures/hasura/README.md b/fixtures/hasura/README.md index cb31e000..a1ab7b15 100644 --- a/fixtures/hasura/README.md +++ b/fixtures/hasura/README.md @@ -13,18 +13,18 @@ arion up -d ## Cheat Sheet -We have two subgraphs, and two connector configurations. So a lot of these -commands are repeated for each subgraph + connector combination. +We have three connector configurations. So a lot of these commands are repeated +for each connector. Run introspection to update connector configuration. To do that through the ddn CLI run these commands in the same directory as this README file: ```sh -$ ddn connector introspect --connector sample_mflix/connector/connector.yaml +$ ddn connector introspect sample_mflix -$ ddn connector introspect --connector chinook/connector/connector.yaml +$ ddn connector introspect chinook -$ ddn connector introspect --connector test_cases/connector/connector.yaml +$ ddn connector introspect test_cases ``` Alternatively run `mongodb-cli-plugin` directly to use the CLI plugin version in @@ -44,9 +44,9 @@ Update Hasura metadata based on connector configuration introspection): ```sh -$ ddn connector-link update sample_mflix --subgraph sample_mflix/subgraph.yaml --env-file sample_mflix/.env.sample_mflix --add-all-resources +$ ddn connector-link update sample_mflix --add-all-resources -$ ddn connector-link update chinook --subgraph chinook/subgraph.yaml --env-file chinook/.env.chinook --add-all-resources +$ ddn connector-link update chinook --add-all-resources -$ ddn connector-link update test_cases --subgraph test_cases/subgraph.yaml --env-file test_cases/.env.test_cases --add-all-resources +$ ddn connector-link update test_cases --add-all-resources ``` diff --git a/fixtures/hasura/chinook/connector/.configuration_metadata b/fixtures/hasura/app/connector/chinook/.configuration_metadata similarity index 100% rename from fixtures/hasura/chinook/connector/.configuration_metadata rename to fixtures/hasura/app/connector/chinook/.configuration_metadata diff --git a/fixtures/hasura/app/connector/chinook/.ddnignore b/fixtures/hasura/app/connector/chinook/.ddnignore new file mode 100644 index 00000000..ed72dd19 --- /dev/null +++ b/fixtures/hasura/app/connector/chinook/.ddnignore @@ -0,0 +1,2 @@ +.env* +compose.yaml diff --git a/fixtures/hasura/app/connector/chinook/.hasura-connector/Dockerfile.chinook b/fixtures/hasura/app/connector/chinook/.hasura-connector/Dockerfile.chinook new file mode 100644 index 00000000..1f2c958f --- /dev/null +++ b/fixtures/hasura/app/connector/chinook/.hasura-connector/Dockerfile.chinook @@ -0,0 +1,2 @@ +FROM ghcr.io/hasura/ndc-mongodb:v1.4.0 +COPY ./ /etc/connector \ No newline at end of file diff --git a/fixtures/hasura/app/connector/chinook/.hasura-connector/connector-metadata.yaml b/fixtures/hasura/app/connector/chinook/.hasura-connector/connector-metadata.yaml new file mode 100644 index 00000000..bc84f63a --- /dev/null +++ b/fixtures/hasura/app/connector/chinook/.hasura-connector/connector-metadata.yaml @@ -0,0 +1,16 @@ +packagingDefinition: + type: PrebuiltDockerImage + dockerImage: ghcr.io/hasura/ndc-mongodb:v1.5.0 +supportedEnvironmentVariables: + - name: MONGODB_DATABASE_URI + description: The URI for the MongoDB database +commands: + update: hasura-ndc-mongodb update +cliPlugin: + name: ndc-mongodb + version: v1.5.0 +dockerComposeWatch: + - path: ./ + target: /etc/connector + action: sync+restart +documentationPage: "https://hasura.info/mongodb-getting-started" diff --git a/fixtures/hasura/app/connector/chinook/compose.yaml b/fixtures/hasura/app/connector/chinook/compose.yaml new file mode 100644 index 00000000..5c4d6bf4 --- /dev/null +++ b/fixtures/hasura/app/connector/chinook/compose.yaml @@ -0,0 +1,13 @@ +services: + app_chinook: + build: + context: . + dockerfile: .hasura-connector/Dockerfile.chinook + environment: + MONGODB_DATABASE_URI: $APP_CHINOOK_MONGODB_DATABASE_URI + OTEL_EXPORTER_OTLP_ENDPOINT: $APP_CHINOOK_OTEL_EXPORTER_OTLP_ENDPOINT + OTEL_SERVICE_NAME: $APP_CHINOOK_OTEL_SERVICE_NAME + extra_hosts: + - local.hasura.dev:host-gateway + ports: + - 7131:8080 diff --git a/fixtures/hasura/test_cases/connector/configuration.json b/fixtures/hasura/app/connector/chinook/configuration.json similarity index 68% rename from fixtures/hasura/test_cases/connector/configuration.json rename to fixtures/hasura/app/connector/chinook/configuration.json index 60693388..5d72bb4e 100644 --- a/fixtures/hasura/test_cases/connector/configuration.json +++ b/fixtures/hasura/app/connector/chinook/configuration.json @@ -1,10 +1,10 @@ { "introspectionOptions": { - "sampleSize": 100, + "sampleSize": 1000, "noValidatorSchema": false, "allSchemaNullable": false }, "serializationOptions": { - "extendedJsonMode": "relaxed" + "extendedJsonMode": "canonical" } } diff --git a/fixtures/hasura/app/connector/chinook/connector.yaml b/fixtures/hasura/app/connector/chinook/connector.yaml new file mode 100644 index 00000000..e3541826 --- /dev/null +++ b/fixtures/hasura/app/connector/chinook/connector.yaml @@ -0,0 +1,14 @@ +kind: Connector +version: v2 +definition: + name: chinook + subgraph: app + source: hasura/mongodb:v1.5.0 + context: . + envMapping: + MONGODB_DATABASE_URI: + fromEnv: APP_CHINOOK_MONGODB_DATABASE_URI + OTEL_EXPORTER_OTLP_ENDPOINT: + fromEnv: APP_CHINOOK_OTEL_EXPORTER_OTLP_ENDPOINT + OTEL_SERVICE_NAME: + fromEnv: APP_CHINOOK_OTEL_SERVICE_NAME diff --git a/fixtures/hasura/chinook/connector/native_mutations/insert_artist.json b/fixtures/hasura/app/connector/chinook/native_mutations/insert_artist.json similarity index 100% rename from fixtures/hasura/chinook/connector/native_mutations/insert_artist.json rename to fixtures/hasura/app/connector/chinook/native_mutations/insert_artist.json diff --git a/fixtures/hasura/chinook/connector/native_mutations/update_track_prices.json b/fixtures/hasura/app/connector/chinook/native_mutations/update_track_prices.json similarity index 100% rename from fixtures/hasura/chinook/connector/native_mutations/update_track_prices.json rename to fixtures/hasura/app/connector/chinook/native_mutations/update_track_prices.json diff --git a/fixtures/hasura/chinook/connector/native_queries/artists_with_albums_and_tracks.json b/fixtures/hasura/app/connector/chinook/native_queries/artists_with_albums_and_tracks.json similarity index 100% rename from fixtures/hasura/chinook/connector/native_queries/artists_with_albums_and_tracks.json rename to fixtures/hasura/app/connector/chinook/native_queries/artists_with_albums_and_tracks.json diff --git a/fixtures/hasura/chinook/connector/schema/Album.json b/fixtures/hasura/app/connector/chinook/schema/Album.json similarity index 88% rename from fixtures/hasura/chinook/connector/schema/Album.json rename to fixtures/hasura/app/connector/chinook/schema/Album.json index a8e61389..f361c03e 100644 --- a/fixtures/hasura/chinook/connector/schema/Album.json +++ b/fixtures/hasura/app/connector/chinook/schema/Album.json @@ -28,8 +28,7 @@ "scalar": "objectId" } } - }, - "description": "Object type for collection Album" + } } } -} +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/schema/Artist.json b/fixtures/hasura/app/connector/chinook/schema/Artist.json similarity index 73% rename from fixtures/hasura/chinook/connector/schema/Artist.json rename to fixtures/hasura/app/connector/chinook/schema/Artist.json index d60bb483..d4104e76 100644 --- a/fixtures/hasura/chinook/connector/schema/Artist.json +++ b/fixtures/hasura/app/connector/chinook/schema/Artist.json @@ -15,9 +15,7 @@ }, "Name": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "_id": { @@ -25,8 +23,7 @@ "scalar": "objectId" } } - }, - "description": "Object type for collection Artist" + } } } -} +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/schema/Customer.json b/fixtures/hasura/app/connector/chinook/schema/Customer.json similarity index 79% rename from fixtures/hasura/chinook/connector/schema/Customer.json rename to fixtures/hasura/app/connector/chinook/schema/Customer.json index 50dbf947..22736ae9 100644 --- a/fixtures/hasura/chinook/connector/schema/Customer.json +++ b/fixtures/hasura/app/connector/chinook/schema/Customer.json @@ -10,16 +10,12 @@ "fields": { "Address": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "City": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "Company": { @@ -31,9 +27,7 @@ }, "Country": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "CustomerId": { @@ -86,18 +80,15 @@ }, "SupportRepId": { "type": { - "nullable": { - "scalar": "int" - } + "scalar": "int" } }, "_id": { "type": { - "scalar": "objectId" + "scalar": "objectId" } } - }, - "description": "Object type for collection Customer" + } } } -} +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/schema/Employee.json b/fixtures/hasura/app/connector/chinook/schema/Employee.json similarity index 59% rename from fixtures/hasura/chinook/connector/schema/Employee.json rename to fixtures/hasura/app/connector/chinook/schema/Employee.json index d6a0524e..ffbeeaf5 100644 --- a/fixtures/hasura/chinook/connector/schema/Employee.json +++ b/fixtures/hasura/app/connector/chinook/schema/Employee.json @@ -10,37 +10,27 @@ "fields": { "Address": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "BirthDate": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "City": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "Country": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "Email": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "EmployeeId": { @@ -50,9 +40,7 @@ }, "Fax": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "FirstName": { @@ -62,9 +50,7 @@ }, "HireDate": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "LastName": { @@ -74,16 +60,12 @@ }, "Phone": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "PostalCode": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "ReportsTo": { @@ -95,25 +77,20 @@ }, "State": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "Title": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "_id": { "type": { - "scalar": "objectId" + "scalar": "objectId" } } - }, - "description": "Object type for collection Employee" + } } } -} +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/schema/Genre.json b/fixtures/hasura/app/connector/chinook/schema/Genre.json similarity index 73% rename from fixtures/hasura/chinook/connector/schema/Genre.json rename to fixtures/hasura/app/connector/chinook/schema/Genre.json index 99cdb709..394be604 100644 --- a/fixtures/hasura/chinook/connector/schema/Genre.json +++ b/fixtures/hasura/app/connector/chinook/schema/Genre.json @@ -15,9 +15,7 @@ }, "Name": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "_id": { @@ -25,8 +23,7 @@ "scalar": "objectId" } } - }, - "description": "Object type for collection Genre" + } } } -} +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/schema/Invoice.json b/fixtures/hasura/app/connector/chinook/schema/Invoice.json similarity index 79% rename from fixtures/hasura/chinook/connector/schema/Invoice.json rename to fixtures/hasura/app/connector/chinook/schema/Invoice.json index aa9a3c91..1b585bbb 100644 --- a/fixtures/hasura/chinook/connector/schema/Invoice.json +++ b/fixtures/hasura/app/connector/chinook/schema/Invoice.json @@ -10,23 +10,17 @@ "fields": { "BillingAddress": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "BillingCity": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "BillingCountry": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "BillingPostalCode": { @@ -68,8 +62,7 @@ "scalar": "objectId" } } - }, - "description": "Object type for collection Invoice" + } } } -} +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/schema/InvoiceLine.json b/fixtures/hasura/app/connector/chinook/schema/InvoiceLine.json similarity index 91% rename from fixtures/hasura/chinook/connector/schema/InvoiceLine.json rename to fixtures/hasura/app/connector/chinook/schema/InvoiceLine.json index 438d023b..ef1b116d 100644 --- a/fixtures/hasura/chinook/connector/schema/InvoiceLine.json +++ b/fixtures/hasura/app/connector/chinook/schema/InvoiceLine.json @@ -38,8 +38,7 @@ "scalar": "objectId" } } - }, - "description": "Object type for collection InvoiceLine" + } } } -} +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/schema/MediaType.json b/fixtures/hasura/app/connector/chinook/schema/MediaType.json similarity index 74% rename from fixtures/hasura/chinook/connector/schema/MediaType.json rename to fixtures/hasura/app/connector/chinook/schema/MediaType.json index 79912879..57ea272b 100644 --- a/fixtures/hasura/chinook/connector/schema/MediaType.json +++ b/fixtures/hasura/app/connector/chinook/schema/MediaType.json @@ -15,9 +15,7 @@ }, "Name": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "_id": { @@ -25,8 +23,7 @@ "scalar": "objectId" } } - }, - "description": "Object type for collection MediaType" + } } } -} +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/schema/Playlist.json b/fixtures/hasura/app/connector/chinook/schema/Playlist.json similarity index 74% rename from fixtures/hasura/chinook/connector/schema/Playlist.json rename to fixtures/hasura/app/connector/chinook/schema/Playlist.json index 74dee27f..414e4078 100644 --- a/fixtures/hasura/chinook/connector/schema/Playlist.json +++ b/fixtures/hasura/app/connector/chinook/schema/Playlist.json @@ -10,9 +10,7 @@ "fields": { "Name": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "PlaylistId": { @@ -25,8 +23,7 @@ "scalar": "objectId" } } - }, - "description": "Object type for collection Playlist" + } } } -} +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/schema/PlaylistTrack.json b/fixtures/hasura/app/connector/chinook/schema/PlaylistTrack.json similarity index 86% rename from fixtures/hasura/chinook/connector/schema/PlaylistTrack.json rename to fixtures/hasura/app/connector/chinook/schema/PlaylistTrack.json index e4382592..a89c10eb 100644 --- a/fixtures/hasura/chinook/connector/schema/PlaylistTrack.json +++ b/fixtures/hasura/app/connector/chinook/schema/PlaylistTrack.json @@ -23,8 +23,7 @@ "scalar": "objectId" } } - }, - "description": "Object type for collection PlaylistTrack" + } } } -} +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/schema/Track.json b/fixtures/hasura/app/connector/chinook/schema/Track.json similarity index 79% rename from fixtures/hasura/chinook/connector/schema/Track.json rename to fixtures/hasura/app/connector/chinook/schema/Track.json index a0d11820..43d8886a 100644 --- a/fixtures/hasura/chinook/connector/schema/Track.json +++ b/fixtures/hasura/app/connector/chinook/schema/Track.json @@ -10,16 +10,12 @@ "fields": { "AlbumId": { "type": { - "nullable": { - "scalar": "int" - } + "scalar": "int" } }, "Bytes": { "type": { - "nullable": { - "scalar": "int" - } + "scalar": "int" } }, "Composer": { @@ -31,9 +27,7 @@ }, "GenreId": { "type": { - "nullable": { - "scalar": "int" - } + "scalar": "int" } }, "MediaTypeId": { @@ -66,8 +60,7 @@ "scalar": "objectId" } } - }, - "description": "Object type for collection Track" + } } } -} +} \ No newline at end of file diff --git a/fixtures/hasura/sample_mflix/connector/.configuration_metadata b/fixtures/hasura/app/connector/sample_mflix/.configuration_metadata similarity index 100% rename from fixtures/hasura/sample_mflix/connector/.configuration_metadata rename to fixtures/hasura/app/connector/sample_mflix/.configuration_metadata diff --git a/fixtures/hasura/app/connector/sample_mflix/.ddnignore b/fixtures/hasura/app/connector/sample_mflix/.ddnignore new file mode 100644 index 00000000..ed72dd19 --- /dev/null +++ b/fixtures/hasura/app/connector/sample_mflix/.ddnignore @@ -0,0 +1,2 @@ +.env* +compose.yaml diff --git a/fixtures/hasura/app/connector/sample_mflix/.hasura-connector/Dockerfile.sample_mflix b/fixtures/hasura/app/connector/sample_mflix/.hasura-connector/Dockerfile.sample_mflix new file mode 100644 index 00000000..1f2c958f --- /dev/null +++ b/fixtures/hasura/app/connector/sample_mflix/.hasura-connector/Dockerfile.sample_mflix @@ -0,0 +1,2 @@ +FROM ghcr.io/hasura/ndc-mongodb:v1.4.0 +COPY ./ /etc/connector \ No newline at end of file diff --git a/fixtures/hasura/app/connector/sample_mflix/.hasura-connector/connector-metadata.yaml b/fixtures/hasura/app/connector/sample_mflix/.hasura-connector/connector-metadata.yaml new file mode 100644 index 00000000..bc84f63a --- /dev/null +++ b/fixtures/hasura/app/connector/sample_mflix/.hasura-connector/connector-metadata.yaml @@ -0,0 +1,16 @@ +packagingDefinition: + type: PrebuiltDockerImage + dockerImage: ghcr.io/hasura/ndc-mongodb:v1.5.0 +supportedEnvironmentVariables: + - name: MONGODB_DATABASE_URI + description: The URI for the MongoDB database +commands: + update: hasura-ndc-mongodb update +cliPlugin: + name: ndc-mongodb + version: v1.5.0 +dockerComposeWatch: + - path: ./ + target: /etc/connector + action: sync+restart +documentationPage: "https://hasura.info/mongodb-getting-started" diff --git a/fixtures/hasura/app/connector/sample_mflix/compose.yaml b/fixtures/hasura/app/connector/sample_mflix/compose.yaml new file mode 100644 index 00000000..ea8f422a --- /dev/null +++ b/fixtures/hasura/app/connector/sample_mflix/compose.yaml @@ -0,0 +1,13 @@ +services: + app_sample_mflix: + build: + context: . + dockerfile: .hasura-connector/Dockerfile.sample_mflix + environment: + MONGODB_DATABASE_URI: $APP_SAMPLE_MFLIX_MONGODB_DATABASE_URI + OTEL_EXPORTER_OTLP_ENDPOINT: $APP_SAMPLE_MFLIX_OTEL_EXPORTER_OTLP_ENDPOINT + OTEL_SERVICE_NAME: $APP_SAMPLE_MFLIX_OTEL_SERVICE_NAME + extra_hosts: + - local.hasura.dev:host-gateway + ports: + - 7130:8080 diff --git a/fixtures/hasura/sample_mflix/connector/configuration.json b/fixtures/hasura/app/connector/sample_mflix/configuration.json similarity index 51% rename from fixtures/hasura/sample_mflix/connector/configuration.json rename to fixtures/hasura/app/connector/sample_mflix/configuration.json index e2c0aaab..5d72bb4e 100644 --- a/fixtures/hasura/sample_mflix/connector/configuration.json +++ b/fixtures/hasura/app/connector/sample_mflix/configuration.json @@ -1,7 +1,10 @@ { "introspectionOptions": { - "sampleSize": 100, + "sampleSize": 1000, "noValidatorSchema": false, "allSchemaNullable": false + }, + "serializationOptions": { + "extendedJsonMode": "canonical" } } diff --git a/fixtures/hasura/app/connector/sample_mflix/connector.yaml b/fixtures/hasura/app/connector/sample_mflix/connector.yaml new file mode 100644 index 00000000..d2b24069 --- /dev/null +++ b/fixtures/hasura/app/connector/sample_mflix/connector.yaml @@ -0,0 +1,14 @@ +kind: Connector +version: v2 +definition: + name: sample_mflix + subgraph: app + source: hasura/mongodb:v1.5.0 + context: . + envMapping: + MONGODB_DATABASE_URI: + fromEnv: APP_SAMPLE_MFLIX_MONGODB_DATABASE_URI + OTEL_EXPORTER_OTLP_ENDPOINT: + fromEnv: APP_SAMPLE_MFLIX_OTEL_EXPORTER_OTLP_ENDPOINT + OTEL_SERVICE_NAME: + fromEnv: APP_SAMPLE_MFLIX_OTEL_SERVICE_NAME diff --git a/fixtures/hasura/app/connector/sample_mflix/native_queries/eq_title.json b/fixtures/hasura/app/connector/sample_mflix/native_queries/eq_title.json new file mode 100644 index 00000000..b1ded9d4 --- /dev/null +++ b/fixtures/hasura/app/connector/sample_mflix/native_queries/eq_title.json @@ -0,0 +1,125 @@ +{ + "name": "eq_title", + "representation": "collection", + "inputCollection": "movies", + "arguments": { + "title": { + "type": { + "scalar": "string" + } + }, + "year": { + "type": { + "scalar": "int" + } + } + }, + "resultDocumentType": "eq_title_project", + "objectTypes": { + "eq_title_project": { + "fields": { + "_id": { + "type": { + "scalar": "objectId" + } + }, + "bar": { + "type": { + "object": "eq_title_project_bar" + } + }, + "foo": { + "type": { + "object": "eq_title_project_foo" + } + }, + "title": { + "type": { + "scalar": "string" + } + }, + "tomatoes": { + "type": { + "nullable": { + "object": "movies_tomatoes" + } + } + }, + "what": { + "type": { + "object": "eq_title_project_what" + } + } + } + }, + "eq_title_project_bar": { + "fields": { + "foo": { + "type": { + "object": "movies_imdb" + } + } + } + }, + "eq_title_project_foo": { + "fields": { + "bar": { + "type": { + "nullable": { + "object": "movies_tomatoes_critic" + } + } + } + } + }, + "eq_title_project_what": { + "fields": { + "the": { + "type": { + "object": "eq_title_project_what_the" + } + } + } + }, + "eq_title_project_what_the": { + "fields": { + "heck": { + "type": { + "scalar": "string" + } + } + } + } + }, + "pipeline": [ + { + "$match": { + "title": "{{ title | string }}", + "year": { + "$gt": "{{ year }}" + } + } + }, + { + "$project": { + "title": 1, + "tomatoes": 1, + "foo.bar": "$tomatoes.critic", + "bar.foo": "$imdb", + "what.the.heck": "hello", + "genres": 1, + "cast": 1 + } + }, + { + "$project": { + "genres": false + } + }, + { + "$project": { + "cast": false + } + } + ] +} diff --git a/fixtures/hasura/sample_mflix/connector/native_queries/extended_json_test_data.json b/fixtures/hasura/app/connector/sample_mflix/native_queries/extended_json_test_data.json similarity index 100% rename from fixtures/hasura/sample_mflix/connector/native_queries/extended_json_test_data.json rename to fixtures/hasura/app/connector/sample_mflix/native_queries/extended_json_test_data.json diff --git a/fixtures/hasura/sample_mflix/connector/native_queries/hello.json b/fixtures/hasura/app/connector/sample_mflix/native_queries/hello.json similarity index 100% rename from fixtures/hasura/sample_mflix/connector/native_queries/hello.json rename to fixtures/hasura/app/connector/sample_mflix/native_queries/hello.json diff --git a/fixtures/hasura/app/connector/sample_mflix/native_queries/native_query.json b/fixtures/hasura/app/connector/sample_mflix/native_queries/native_query.json new file mode 100644 index 00000000..41dc6b65 --- /dev/null +++ b/fixtures/hasura/app/connector/sample_mflix/native_queries/native_query.json @@ -0,0 +1,120 @@ +{ + "name": "native_query", + "representation": "collection", + "inputCollection": "movies", + "arguments": { + "title": { + "type": { + "scalar": "string" + } + } + }, + "resultDocumentType": "native_query_project", + "objectTypes": { + "native_query_project": { + "fields": { + "_id": { + "type": { + "scalar": "objectId" + } + }, + "bar": { + "type": { + "object": "native_query_project_bar" + } + }, + "foo": { + "type": { + "object": "native_query_project_foo" + } + }, + "title": { + "type": { + "scalar": "string" + } + }, + "tomatoes": { + "type": { + "nullable": { + "object": "movies_tomatoes" + } + } + }, + "what": { + "type": { + "object": "native_query_project_what" + } + } + } + }, + "native_query_project_bar": { + "fields": { + "foo": { + "type": { + "object": "movies_imdb" + } + } + } + }, + "native_query_project_foo": { + "fields": { + "bar": { + "type": { + "nullable": { + "object": "movies_tomatoes_critic" + } + } + } + } + }, + "native_query_project_what": { + "fields": { + "the": { + "type": { + "object": "native_query_project_what_the" + } + } + } + }, + "native_query_project_what_the": { + "fields": { + "heck": { + "type": { + "scalar": "string" + } + } + } + } + }, + "pipeline": [ + { + "$match": { + "title": "{{ title }}", + "year": { + "$gt": "$$ROOT" + } + } + }, + { + "$project": { + "title": 1, + "tomatoes": 1, + "foo.bar": "$tomatoes.critic", + "bar.foo": "$imdb", + "what.the.heck": "hello", + "genres": 1, + "cast": 1 + } + }, + { + "$project": { + "genres": false + } + }, + { + "$project": { + "cast": false + } + } + ] +} \ No newline at end of file diff --git a/fixtures/hasura/sample_mflix/connector/native_queries/title_word_frequency.json b/fixtures/hasura/app/connector/sample_mflix/native_queries/title_word_frequency.json similarity index 96% rename from fixtures/hasura/sample_mflix/connector/native_queries/title_word_frequency.json rename to fixtures/hasura/app/connector/sample_mflix/native_queries/title_word_frequency.json index 397d66ee..9d6fc8ac 100644 --- a/fixtures/hasura/sample_mflix/connector/native_queries/title_word_frequency.json +++ b/fixtures/hasura/app/connector/sample_mflix/native_queries/title_word_frequency.json @@ -23,7 +23,6 @@ "pipeline": [ { "$replaceWith": { - "title": "$title", "title_words": { "$split": [ "$title", @@ -46,4 +45,4 @@ } } ] -} \ No newline at end of file +} diff --git a/fixtures/hasura/sample_mflix/connector/schema/comments.json b/fixtures/hasura/app/connector/sample_mflix/schema/comments.json similarity index 100% rename from fixtures/hasura/sample_mflix/connector/schema/comments.json rename to fixtures/hasura/app/connector/sample_mflix/schema/comments.json diff --git a/fixtures/hasura/sample_mflix/connector/schema/movies.json b/fixtures/hasura/app/connector/sample_mflix/schema/movies.json similarity index 92% rename from fixtures/hasura/sample_mflix/connector/schema/movies.json rename to fixtures/hasura/app/connector/sample_mflix/schema/movies.json index b7dc4ca5..a56df100 100644 --- a/fixtures/hasura/sample_mflix/connector/schema/movies.json +++ b/fixtures/hasura/app/connector/sample_mflix/schema/movies.json @@ -36,8 +36,10 @@ }, "directors": { "type": { - "arrayOf": { - "scalar": "string" + "nullable": { + "arrayOf": { + "scalar": "string" + } } } }, @@ -50,8 +52,10 @@ }, "genres": { "type": { - "arrayOf": { - "scalar": "string" + "nullable": { + "arrayOf": { + "scalar": "string" + } } } }, @@ -273,12 +277,16 @@ }, "numReviews": { "type": { - "scalar": "int" + "nullable": { + "scalar": "int" + } } }, "rating": { "type": { - "scalar": "double" + "nullable": { + "scalar": "double" + } } } } @@ -299,7 +307,9 @@ }, "rating": { "type": { - "scalar": "double" + "nullable": { + "scalar": "double" + } } } } diff --git a/fixtures/hasura/sample_mflix/connector/schema/sessions.json b/fixtures/hasura/app/connector/sample_mflix/schema/sessions.json similarity index 100% rename from fixtures/hasura/sample_mflix/connector/schema/sessions.json rename to fixtures/hasura/app/connector/sample_mflix/schema/sessions.json diff --git a/fixtures/hasura/sample_mflix/connector/schema/theaters.json b/fixtures/hasura/app/connector/sample_mflix/schema/theaters.json similarity index 100% rename from fixtures/hasura/sample_mflix/connector/schema/theaters.json rename to fixtures/hasura/app/connector/sample_mflix/schema/theaters.json diff --git a/fixtures/hasura/sample_mflix/connector/schema/users.json b/fixtures/hasura/app/connector/sample_mflix/schema/users.json similarity index 100% rename from fixtures/hasura/sample_mflix/connector/schema/users.json rename to fixtures/hasura/app/connector/sample_mflix/schema/users.json diff --git a/fixtures/hasura/chinook/metadata/commands/.gitkeep b/fixtures/hasura/app/connector/test_cases/.configuration_metadata similarity index 100% rename from fixtures/hasura/chinook/metadata/commands/.gitkeep rename to fixtures/hasura/app/connector/test_cases/.configuration_metadata diff --git a/fixtures/hasura/app/connector/test_cases/.ddnignore b/fixtures/hasura/app/connector/test_cases/.ddnignore new file mode 100644 index 00000000..ed72dd19 --- /dev/null +++ b/fixtures/hasura/app/connector/test_cases/.ddnignore @@ -0,0 +1,2 @@ +.env* +compose.yaml diff --git a/fixtures/hasura/app/connector/test_cases/.hasura-connector/Dockerfile.test_cases b/fixtures/hasura/app/connector/test_cases/.hasura-connector/Dockerfile.test_cases new file mode 100644 index 00000000..1f2c958f --- /dev/null +++ b/fixtures/hasura/app/connector/test_cases/.hasura-connector/Dockerfile.test_cases @@ -0,0 +1,2 @@ +FROM ghcr.io/hasura/ndc-mongodb:v1.4.0 +COPY ./ /etc/connector \ No newline at end of file diff --git a/fixtures/hasura/app/connector/test_cases/.hasura-connector/connector-metadata.yaml b/fixtures/hasura/app/connector/test_cases/.hasura-connector/connector-metadata.yaml new file mode 100644 index 00000000..bc84f63a --- /dev/null +++ b/fixtures/hasura/app/connector/test_cases/.hasura-connector/connector-metadata.yaml @@ -0,0 +1,16 @@ +packagingDefinition: + type: PrebuiltDockerImage + dockerImage: ghcr.io/hasura/ndc-mongodb:v1.5.0 +supportedEnvironmentVariables: + - name: MONGODB_DATABASE_URI + description: The URI for the MongoDB database +commands: + update: hasura-ndc-mongodb update +cliPlugin: + name: ndc-mongodb + version: v1.5.0 +dockerComposeWatch: + - path: ./ + target: /etc/connector + action: sync+restart +documentationPage: "https://hasura.info/mongodb-getting-started" diff --git a/fixtures/hasura/app/connector/test_cases/compose.yaml b/fixtures/hasura/app/connector/test_cases/compose.yaml new file mode 100644 index 00000000..2c2d8feb --- /dev/null +++ b/fixtures/hasura/app/connector/test_cases/compose.yaml @@ -0,0 +1,13 @@ +services: + app_test_cases: + build: + context: . + dockerfile: .hasura-connector/Dockerfile.test_cases + environment: + MONGODB_DATABASE_URI: $APP_TEST_CASES_MONGODB_DATABASE_URI + OTEL_EXPORTER_OTLP_ENDPOINT: $APP_TEST_CASES_OTEL_EXPORTER_OTLP_ENDPOINT + OTEL_SERVICE_NAME: $APP_TEST_CASES_OTEL_SERVICE_NAME + extra_hosts: + - local.hasura.dev:host-gateway + ports: + - 7132:8080 diff --git a/fixtures/hasura/chinook/connector/configuration.json b/fixtures/hasura/app/connector/test_cases/configuration.json similarity index 51% rename from fixtures/hasura/chinook/connector/configuration.json rename to fixtures/hasura/app/connector/test_cases/configuration.json index e2c0aaab..5d72bb4e 100644 --- a/fixtures/hasura/chinook/connector/configuration.json +++ b/fixtures/hasura/app/connector/test_cases/configuration.json @@ -1,7 +1,10 @@ { "introspectionOptions": { - "sampleSize": 100, + "sampleSize": 1000, "noValidatorSchema": false, "allSchemaNullable": false + }, + "serializationOptions": { + "extendedJsonMode": "canonical" } } diff --git a/fixtures/hasura/app/connector/test_cases/connector.yaml b/fixtures/hasura/app/connector/test_cases/connector.yaml new file mode 100644 index 00000000..c156e640 --- /dev/null +++ b/fixtures/hasura/app/connector/test_cases/connector.yaml @@ -0,0 +1,14 @@ +kind: Connector +version: v2 +definition: + name: test_cases + subgraph: app + source: hasura/mongodb:v1.5.0 + context: . + envMapping: + MONGODB_DATABASE_URI: + fromEnv: APP_TEST_CASES_MONGODB_DATABASE_URI + OTEL_EXPORTER_OTLP_ENDPOINT: + fromEnv: APP_TEST_CASES_OTEL_EXPORTER_OTLP_ENDPOINT + OTEL_SERVICE_NAME: + fromEnv: APP_TEST_CASES_OTEL_SERVICE_NAME diff --git a/fixtures/hasura/test_cases/connector/schema/nested_collection.json b/fixtures/hasura/app/connector/test_cases/schema/nested_collection.json similarity index 100% rename from fixtures/hasura/test_cases/connector/schema/nested_collection.json rename to fixtures/hasura/app/connector/test_cases/schema/nested_collection.json diff --git a/fixtures/hasura/test_cases/connector/schema/nested_field_with_dollar.json b/fixtures/hasura/app/connector/test_cases/schema/nested_field_with_dollar.json similarity index 100% rename from fixtures/hasura/test_cases/connector/schema/nested_field_with_dollar.json rename to fixtures/hasura/app/connector/test_cases/schema/nested_field_with_dollar.json diff --git a/fixtures/hasura/test_cases/connector/schema/weird_field_names.json b/fixtures/hasura/app/connector/test_cases/schema/weird_field_names.json similarity index 100% rename from fixtures/hasura/test_cases/connector/schema/weird_field_names.json rename to fixtures/hasura/app/connector/test_cases/schema/weird_field_names.json diff --git a/fixtures/hasura/globals/.env.globals.cloud b/fixtures/hasura/app/metadata/.keep similarity index 100% rename from fixtures/hasura/globals/.env.globals.cloud rename to fixtures/hasura/app/metadata/.keep diff --git a/fixtures/hasura/chinook/metadata/models/Album.hml b/fixtures/hasura/app/metadata/Album.hml similarity index 64% rename from fixtures/hasura/chinook/metadata/models/Album.hml rename to fixtures/hasura/app/metadata/Album.hml index 79d9651d..eb4505fe 100644 --- a/fixtures/hasura/chinook/metadata/models/Album.hml +++ b/fixtures/hasura/app/metadata/Album.hml @@ -5,7 +5,7 @@ definition: name: Album fields: - name: id - type: ObjectId! + type: ObjectId_1! - name: albumId type: Int! - name: artistId @@ -31,7 +31,6 @@ definition: title: column: name: Title - description: Object type for collection Album --- kind: TypePermissions @@ -51,30 +50,50 @@ definition: kind: BooleanExpressionType version: v1 definition: - name: AlbumComparisonExp + name: AlbumBoolExp operand: object: type: Album comparableFields: - fieldName: id - booleanExpressionType: ObjectIdComparisonExp + booleanExpressionType: ObjectIdBoolExp_1 - fieldName: albumId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: artistId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: title - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp comparableRelationships: - relationshipName: artist - booleanExpressionType: ArtistComparisonExp - relationshipName: tracks - booleanExpressionType: TrackComparisonExp logicalOperators: enable: true isNull: enable: true graphql: - typeName: AlbumComparisonExp + typeName: AlbumBoolExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: AlbumAggExp + operand: + object: + aggregatedType: Album + aggregatableFields: + - fieldName: id + aggregateExpression: ObjectIdAggExp_1 + - fieldName: albumId + aggregateExpression: IntAggExp + - fieldName: artistId + aggregateExpression: IntAggExp + - fieldName: title + aggregateExpression: StringAggExp + count: + enable: true + graphql: + selectTypeName: AlbumAggExp --- kind: Model @@ -85,7 +104,8 @@ definition: source: dataConnectorName: chinook collection: Album - filterExpressionType: AlbumComparisonExp + filterExpressionType: AlbumBoolExp + aggregateExpression: AlbumAggExp orderableFields: - fieldName: id orderByDirections: @@ -102,11 +122,20 @@ definition: graphql: selectMany: queryRootField: album + subscription: + rootField: album selectUniques: - queryRootField: albumById uniqueIdentifier: - id + subscription: + rootField: albumById orderByExpressionType: AlbumOrderBy + filterInputTypeName: AlbumFilterInput + aggregate: + queryRootField: albumAggregate + subscription: + rootField: albumAggregate --- kind: ModelPermissions @@ -117,4 +146,5 @@ definition: - role: admin select: filter: null + allowSubscriptions: true diff --git a/fixtures/hasura/chinook/metadata/models/Artist.hml b/fixtures/hasura/app/metadata/Artist.hml similarity index 62% rename from fixtures/hasura/chinook/metadata/models/Artist.hml rename to fixtures/hasura/app/metadata/Artist.hml index bcb4ff50..38755178 100644 --- a/fixtures/hasura/chinook/metadata/models/Artist.hml +++ b/fixtures/hasura/app/metadata/Artist.hml @@ -5,11 +5,11 @@ definition: name: Artist fields: - name: id - type: ObjectId! + type: ObjectId_1! - name: artistId type: Int! - name: name - type: String + type: String! graphql: typeName: Artist inputTypeName: ArtistInput @@ -26,7 +26,6 @@ definition: name: column: name: Name - description: Object type for collection Artist --- kind: TypePermissions @@ -45,26 +44,45 @@ definition: kind: BooleanExpressionType version: v1 definition: - name: ArtistComparisonExp + name: ArtistBoolExp operand: object: type: Artist comparableFields: - fieldName: id - booleanExpressionType: ObjectIdComparisonExp + booleanExpressionType: ObjectIdBoolExp_1 - fieldName: artistId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: name - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp comparableRelationships: - relationshipName: albums - booleanExpressionType: AlbumComparisonExp logicalOperators: enable: true isNull: enable: true graphql: - typeName: ArtistComparisonExp + typeName: ArtistBoolExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: ArtistAggExp + operand: + object: + aggregatedType: Artist + aggregatableFields: + - fieldName: id + aggregateExpression: ObjectIdAggExp_1 + - fieldName: artistId + aggregateExpression: IntAggExp + - fieldName: name + aggregateExpression: StringAggExp + count: + enable: true + graphql: + selectTypeName: ArtistAggExp --- kind: Model @@ -75,7 +93,8 @@ definition: source: dataConnectorName: chinook collection: Artist - filterExpressionType: ArtistComparisonExp + filterExpressionType: ArtistBoolExp + aggregateExpression: ArtistAggExp orderableFields: - fieldName: id orderByDirections: @@ -89,11 +108,20 @@ definition: graphql: selectMany: queryRootField: artist + subscription: + rootField: artist selectUniques: - queryRootField: artistById uniqueIdentifier: - id + subscription: + rootField: artistById orderByExpressionType: ArtistOrderBy + filterInputTypeName: ArtistFilterInput + aggregate: + queryRootField: artistAggregate + subscription: + rootField: artistAggregate --- kind: ModelPermissions @@ -104,4 +132,5 @@ definition: - role: admin select: filter: null + allowSubscriptions: true diff --git a/fixtures/hasura/chinook/metadata/ArtistsWithAlbumsAndTracks.hml b/fixtures/hasura/app/metadata/ArtistsWithAlbumsAndTracks.hml similarity index 68% rename from fixtures/hasura/chinook/metadata/ArtistsWithAlbumsAndTracks.hml rename to fixtures/hasura/app/metadata/ArtistsWithAlbumsAndTracks.hml index 9070d45b..9d6f0cd2 100644 --- a/fixtures/hasura/chinook/metadata/ArtistsWithAlbumsAndTracks.hml +++ b/fixtures/hasura/app/metadata/ArtistsWithAlbumsAndTracks.hml @@ -5,7 +5,7 @@ definition: name: AlbumWithTracks fields: - name: id - type: ObjectId! + type: ObjectId_1! - name: title type: String! - name: tracks @@ -40,27 +40,6 @@ definition: - title - tracks ---- -kind: BooleanExpressionType -version: v1 -definition: - name: AlbumWithTracksComparisonExp - operand: - object: - type: AlbumWithTracks - comparableFields: - - fieldName: id - booleanExpressionType: ObjectIdComparisonExp - - fieldName: title - booleanExpressionType: StringComparisonExp - comparableRelationships: [] - logicalOperators: - enable: true - isNull: - enable: true - graphql: - typeName: AlbumWithTracksComparisonExp - --- kind: ObjectType version: v1 @@ -68,7 +47,7 @@ definition: name: ArtistWithAlbumsAndTracks fields: - name: id - type: ObjectId! + type: ObjectId_1! - name: albums type: "[AlbumWithTracks!]!" - name: name @@ -107,22 +86,63 @@ definition: kind: BooleanExpressionType version: v1 definition: - name: ArtistWithAlbumsAndTracksComparisonExp + name: AlbumWithTracksBoolExp + operand: + object: + type: AlbumWithTracks + comparableFields: + - fieldName: id + booleanExpressionType: ObjectIdBoolExp_1 + - fieldName: title + booleanExpressionType: StringBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: AlbumWithTracksBoolExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: ArtistWithAlbumsAndTracksBoolExp operand: object: type: ArtistWithAlbumsAndTracks comparableFields: - fieldName: id - booleanExpressionType: ObjectIdComparisonExp + booleanExpressionType: ObjectIdBoolExp_1 + - fieldName: albums + booleanExpressionType: AlbumWithTracksBoolExp - fieldName: name - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp comparableRelationships: [] logicalOperators: enable: true isNull: enable: true graphql: - typeName: ArtistWithAlbumsAndTracksComparisonExp + typeName: ArtistWithAlbumsAndTracksBoolExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: ArtistWithAlbumsAndTracksAggExp + operand: + object: + aggregatedType: ArtistWithAlbumsAndTracks + aggregatableFields: + - fieldName: id + aggregateExpression: ObjectIdAggExp_1 + - fieldName: name + aggregateExpression: StringAggExp + count: + enable: true + graphql: + selectTypeName: ArtistWithAlbumsAndTracksAggExp --- kind: Model @@ -133,7 +153,8 @@ definition: source: dataConnectorName: chinook collection: artists_with_albums_and_tracks - filterExpressionType: ArtistWithAlbumsAndTracksComparisonExp + filterExpressionType: ArtistWithAlbumsAndTracksBoolExp + aggregateExpression: ArtistWithAlbumsAndTracksAggExp orderableFields: - fieldName: id orderByDirections: @@ -147,11 +168,20 @@ definition: graphql: selectMany: queryRootField: artistsWithAlbumsAndTracks + subscription: + rootField: artistsWithAlbumsAndTracks selectUniques: - queryRootField: artistsWithAlbumsAndTracksById uniqueIdentifier: - id + subscription: + rootField: artistsWithAlbumsAndTracksById orderByExpressionType: ArtistsWithAlbumsAndTracksOrderBy + filterInputTypeName: ArtistsWithAlbumsAndTracksFilterInput + aggregate: + queryRootField: artistsWithAlbumsAndTracksAggregate + subscription: + rootField: artistsWithAlbumsAndTracksAggregate description: combines artist, albums, and tracks into a single document per artist --- @@ -163,4 +193,5 @@ definition: - role: admin select: filter: null + allowSubscriptions: true diff --git a/fixtures/hasura/sample_mflix/metadata/models/Comments.hml b/fixtures/hasura/app/metadata/Comments.hml similarity index 74% rename from fixtures/hasura/sample_mflix/metadata/models/Comments.hml rename to fixtures/hasura/app/metadata/Comments.hml index f6bb1d91..ca8c80ca 100644 --- a/fixtures/hasura/sample_mflix/metadata/models/Comments.hml +++ b/fixtures/hasura/app/metadata/Comments.hml @@ -71,49 +71,58 @@ definition: kind: BooleanExpressionType version: v1 definition: - name: CommentsComparisonExp + name: CommentsBoolExp operand: object: type: Comments comparableFields: - fieldName: id - booleanExpressionType: ObjectIdComparisonExp + booleanExpressionType: ObjectIdBoolExp - fieldName: date - booleanExpressionType: DateComparisonExp + booleanExpressionType: DateBoolExp - fieldName: email - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: movieId - booleanExpressionType: ObjectIdComparisonExp + booleanExpressionType: ObjectIdBoolExp - fieldName: name - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: text - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp comparableRelationships: - relationshipName: movie - booleanExpressionType: MoviesComparisonExp - relationshipName: user - booleanExpressionType: UsersComparisonExp logicalOperators: enable: true isNull: enable: true graphql: - typeName: CommentsComparisonExp + typeName: CommentsBoolExp --- kind: AggregateExpression version: v1 definition: - name: CommentsAggregateExp + name: CommentsAggExp operand: object: aggregatedType: Comments aggregatableFields: + - fieldName: id + aggregateExpression: ObjectIdAggExp - fieldName: date - aggregateExpression: DateAggregateExp - count: { enable: true } + aggregateExpression: DateAggExp + - fieldName: email + aggregateExpression: StringAggExp + - fieldName: movieId + aggregateExpression: ObjectIdAggExp + - fieldName: name + aggregateExpression: StringAggExp + - fieldName: text + aggregateExpression: StringAggExp + count: + enable: true graphql: - selectTypeName: CommentsAggregateExp + selectTypeName: CommentsAggExp --- kind: Model @@ -124,8 +133,8 @@ definition: source: dataConnectorName: sample_mflix collection: comments - aggregateExpression: CommentsAggregateExp - filterExpressionType: CommentsComparisonExp + filterExpressionType: CommentsBoolExp + aggregateExpression: CommentsAggExp orderableFields: - fieldName: id orderByDirections: @@ -146,16 +155,22 @@ definition: orderByDirections: enableAll: true graphql: - aggregate: - queryRootField: commentsAggregate - filterInputTypeName: CommentsFilterInput selectMany: queryRootField: comments + subscription: + rootField: comments selectUniques: - queryRootField: commentsById uniqueIdentifier: - id + subscription: + rootField: commentsById orderByExpressionType: CommentsOrderBy + filterInputTypeName: CommentsFilterInput + aggregate: + queryRootField: commentsAggregate + subscription: + rootField: commentsAggregate --- kind: ModelPermissions @@ -166,6 +181,7 @@ definition: - role: admin select: filter: null + allowSubscriptions: true - role: user select: filter: diff --git a/fixtures/hasura/chinook/metadata/models/Customer.hml b/fixtures/hasura/app/metadata/Customer.hml similarity index 63% rename from fixtures/hasura/chinook/metadata/models/Customer.hml rename to fixtures/hasura/app/metadata/Customer.hml index 3a707bcb..61dfddc6 100644 --- a/fixtures/hasura/chinook/metadata/models/Customer.hml +++ b/fixtures/hasura/app/metadata/Customer.hml @@ -5,15 +5,15 @@ definition: name: Customer fields: - name: id - type: ObjectId! + type: ObjectId_1! - name: address - type: String + type: String! - name: city - type: String + type: String! - name: company type: String - name: country - type: String + type: String! - name: customerId type: Int! - name: email @@ -31,7 +31,7 @@ definition: - name: state type: String - name: supportRepId - type: Int + type: Int! graphql: typeName: Customer inputTypeName: CustomerInput @@ -81,7 +81,6 @@ definition: supportRepId: column: name: SupportRepId - description: Object type for collection Customer --- kind: TypePermissions @@ -111,50 +110,90 @@ definition: kind: BooleanExpressionType version: v1 definition: - name: CustomerComparisonExp + name: CustomerBoolExp operand: object: type: Customer comparableFields: - fieldName: id - booleanExpressionType: ObjectIdComparisonExp + booleanExpressionType: ObjectIdBoolExp_1 - fieldName: address - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: city - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: company - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: country - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: customerId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: email - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: fax - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: firstName - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: lastName - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: phone - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: postalCode - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: state - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: supportRepId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp comparableRelationships: - relationshipName: invoices - booleanExpressionType: InvoiceComparisonExp - relationshipName: supportRep - booleanExpressionType: EmployeeComparisonExp logicalOperators: enable: true isNull: enable: true graphql: - typeName: CustomerComparisonExp + typeName: CustomerBoolExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: CustomerAggExp + operand: + object: + aggregatedType: Customer + aggregatableFields: + - fieldName: id + aggregateExpression: ObjectIdAggExp_1 + - fieldName: address + aggregateExpression: StringAggExp + - fieldName: city + aggregateExpression: StringAggExp + - fieldName: company + aggregateExpression: StringAggExp + - fieldName: country + aggregateExpression: StringAggExp + - fieldName: customerId + aggregateExpression: IntAggExp + - fieldName: email + aggregateExpression: StringAggExp + - fieldName: fax + aggregateExpression: StringAggExp + - fieldName: firstName + aggregateExpression: StringAggExp + - fieldName: lastName + aggregateExpression: StringAggExp + - fieldName: phone + aggregateExpression: StringAggExp + - fieldName: postalCode + aggregateExpression: StringAggExp + - fieldName: state + aggregateExpression: StringAggExp + - fieldName: supportRepId + aggregateExpression: IntAggExp + count: + enable: true + graphql: + selectTypeName: CustomerAggExp --- kind: Model @@ -165,7 +204,8 @@ definition: source: dataConnectorName: chinook collection: Customer - filterExpressionType: CustomerComparisonExp + filterExpressionType: CustomerBoolExp + aggregateExpression: CustomerAggExp orderableFields: - fieldName: id orderByDirections: @@ -212,11 +252,20 @@ definition: graphql: selectMany: queryRootField: customer + subscription: + rootField: customer selectUniques: - queryRootField: customerById uniqueIdentifier: - id + subscription: + rootField: customerById orderByExpressionType: CustomerOrderBy + filterInputTypeName: CustomerFilterInput + aggregate: + queryRootField: customerAggregate + subscription: + rootField: customerAggregate --- kind: ModelPermissions @@ -227,4 +276,5 @@ definition: - role: admin select: filter: null + allowSubscriptions: true diff --git a/fixtures/hasura/chinook/metadata/models/Employee.hml b/fixtures/hasura/app/metadata/Employee.hml similarity index 61% rename from fixtures/hasura/chinook/metadata/models/Employee.hml rename to fixtures/hasura/app/metadata/Employee.hml index be33d8b0..5f926da4 100644 --- a/fixtures/hasura/chinook/metadata/models/Employee.hml +++ b/fixtures/hasura/app/metadata/Employee.hml @@ -5,37 +5,37 @@ definition: name: Employee fields: - name: id - type: ObjectId! + type: ObjectId_1! - name: address - type: String + type: String! - name: birthDate - type: String + type: String! - name: city - type: String + type: String! - name: country - type: String + type: String! - name: email - type: String + type: String! - name: employeeId type: Int! - name: fax - type: String + type: String! - name: firstName type: String! - name: hireDate - type: String + type: String! - name: lastName type: String! - name: phone - type: String + type: String! - name: postalCode - type: String + type: String! - name: reportsTo type: Int - name: state - type: String + type: String! - name: title - type: String + type: String! graphql: typeName: Employee inputTypeName: EmployeeInput @@ -91,7 +91,6 @@ definition: title: column: name: Title - description: Object type for collection Employee --- kind: TypePermissions @@ -123,56 +122,99 @@ definition: kind: BooleanExpressionType version: v1 definition: - name: EmployeeComparisonExp + name: EmployeeBoolExp operand: object: type: Employee comparableFields: - fieldName: id - booleanExpressionType: ObjectIdComparisonExp + booleanExpressionType: ObjectIdBoolExp_1 - fieldName: address - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: birthDate - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: city - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: country - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: email - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: employeeId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: fax - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: firstName - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: hireDate - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: lastName - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: phone - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: postalCode - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: reportsTo - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: state - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: title - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp comparableRelationships: - relationshipName: directReports - booleanExpressionType: EmployeeComparisonExp - relationshipName: manager - booleanExpressionType: EmployeeComparisonExp - relationshipName: supportRepCustomers - booleanExpressionType: CustomerComparisonExp logicalOperators: enable: true isNull: enable: true graphql: - typeName: EmployeeComparisonExp + typeName: EmployeeBoolExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: EmployeeAggExp + operand: + object: + aggregatedType: Employee + aggregatableFields: + - fieldName: id + aggregateExpression: ObjectIdAggExp_1 + - fieldName: address + aggregateExpression: StringAggExp + - fieldName: birthDate + aggregateExpression: StringAggExp + - fieldName: city + aggregateExpression: StringAggExp + - fieldName: country + aggregateExpression: StringAggExp + - fieldName: email + aggregateExpression: StringAggExp + - fieldName: employeeId + aggregateExpression: IntAggExp + - fieldName: fax + aggregateExpression: StringAggExp + - fieldName: firstName + aggregateExpression: StringAggExp + - fieldName: hireDate + aggregateExpression: StringAggExp + - fieldName: lastName + aggregateExpression: StringAggExp + - fieldName: phone + aggregateExpression: StringAggExp + - fieldName: postalCode + aggregateExpression: StringAggExp + - fieldName: reportsTo + aggregateExpression: IntAggExp + - fieldName: state + aggregateExpression: StringAggExp + - fieldName: title + aggregateExpression: StringAggExp + count: + enable: true + graphql: + selectTypeName: EmployeeAggExp --- kind: Model @@ -183,7 +225,8 @@ definition: source: dataConnectorName: chinook collection: Employee - filterExpressionType: EmployeeComparisonExp + filterExpressionType: EmployeeBoolExp + aggregateExpression: EmployeeAggExp orderableFields: - fieldName: id orderByDirections: @@ -236,11 +279,20 @@ definition: graphql: selectMany: queryRootField: employee + subscription: + rootField: employee selectUniques: - queryRootField: employeeById uniqueIdentifier: - id + subscription: + rootField: employeeById orderByExpressionType: EmployeeOrderBy + filterInputTypeName: EmployeeFilterInput + aggregate: + queryRootField: employeeAggregate + subscription: + rootField: employeeAggregate --- kind: ModelPermissions @@ -251,4 +303,5 @@ definition: - role: admin select: filter: null + allowSubscriptions: true diff --git a/fixtures/hasura/app/metadata/EqTitle.hml b/fixtures/hasura/app/metadata/EqTitle.hml new file mode 100644 index 00000000..587a2dbb --- /dev/null +++ b/fixtures/hasura/app/metadata/EqTitle.hml @@ -0,0 +1,352 @@ +--- +kind: ObjectType +version: v1 +definition: + name: EqTitleProjectBar + fields: + - name: foo + type: MoviesImdb! + graphql: + typeName: EqTitleProjectBar + inputTypeName: EqTitleProjectBarInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: eq_title_project_bar + +--- +kind: TypePermissions +version: v1 +definition: + typeName: EqTitleProjectBar + permissions: + - role: admin + output: + allowedFields: + - foo + +--- +kind: ObjectType +version: v1 +definition: + name: EqTitleProjectFoo + fields: + - name: bar + type: MoviesTomatoesCritic + graphql: + typeName: EqTitleProjectFoo + inputTypeName: EqTitleProjectFooInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: eq_title_project_foo + +--- +kind: TypePermissions +version: v1 +definition: + typeName: EqTitleProjectFoo + permissions: + - role: admin + output: + allowedFields: + - bar + +--- +kind: ObjectType +version: v1 +definition: + name: EqTitleProjectWhatThe + fields: + - name: heck + type: String! + graphql: + typeName: EqTitleProjectWhatThe + inputTypeName: EqTitleProjectWhatTheInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: eq_title_project_what_the + +--- +kind: TypePermissions +version: v1 +definition: + typeName: EqTitleProjectWhatThe + permissions: + - role: admin + output: + allowedFields: + - heck + +--- +kind: ObjectType +version: v1 +definition: + name: EqTitleProjectWhat + fields: + - name: the + type: EqTitleProjectWhatThe! + graphql: + typeName: EqTitleProjectWhat + inputTypeName: EqTitleProjectWhatInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: eq_title_project_what + +--- +kind: TypePermissions +version: v1 +definition: + typeName: EqTitleProjectWhat + permissions: + - role: admin + output: + allowedFields: + - the + +--- +kind: ObjectType +version: v1 +definition: + name: EqTitleProject + fields: + - name: id + type: ObjectId! + - name: bar + type: EqTitleProjectBar! + - name: foo + type: EqTitleProjectFoo! + - name: title + type: String! + - name: tomatoes + type: MoviesTomatoes + - name: what + type: EqTitleProjectWhat! + graphql: + typeName: EqTitleProject + inputTypeName: EqTitleProjectInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: eq_title_project + fieldMapping: + id: + column: + name: _id + bar: + column: + name: bar + foo: + column: + name: foo + title: + column: + name: title + tomatoes: + column: + name: tomatoes + what: + column: + name: what + +--- +kind: TypePermissions +version: v1 +definition: + typeName: EqTitleProject + permissions: + - role: admin + output: + allowedFields: + - id + - bar + - foo + - title + - tomatoes + - what + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: EqTitleProjectBarBoolExp + operand: + object: + type: EqTitleProjectBar + comparableFields: + - fieldName: foo + booleanExpressionType: MoviesImdbBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: EqTitleProjectBarBoolExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: EqTitleProjectFooBoolExp + operand: + object: + type: EqTitleProjectFoo + comparableFields: + - fieldName: bar + booleanExpressionType: MoviesTomatoesCriticBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: EqTitleProjectFooBoolExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: EqTitleProjectWhatTheBoolExp + operand: + object: + type: EqTitleProjectWhatThe + comparableFields: + - fieldName: heck + booleanExpressionType: StringBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: EqTitleProjectWhatTheBoolExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: EqTitleProjectWhatBoolExp + operand: + object: + type: EqTitleProjectWhat + comparableFields: + - fieldName: the + booleanExpressionType: EqTitleProjectWhatTheBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: EqTitleProjectWhatBoolExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: EqTitleProjectBoolExp + operand: + object: + type: EqTitleProject + comparableFields: + - fieldName: id + booleanExpressionType: ObjectIdBoolExp + - fieldName: bar + booleanExpressionType: EqTitleProjectBarBoolExp + - fieldName: foo + booleanExpressionType: EqTitleProjectFooBoolExp + - fieldName: title + booleanExpressionType: StringBoolExp + - fieldName: tomatoes + booleanExpressionType: MoviesTomatoesBoolExp + - fieldName: what + booleanExpressionType: EqTitleProjectWhatBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: EqTitleProjectBoolExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: EqTitleProjectAggExp + operand: + object: + aggregatedType: EqTitleProject + aggregatableFields: + - fieldName: id + aggregateExpression: ObjectIdAggExp + - fieldName: title + aggregateExpression: StringAggExp + count: + enable: true + graphql: + selectTypeName: EqTitleProjectAggExp + +--- +kind: Model +version: v1 +definition: + name: EqTitle + objectType: EqTitleProject + arguments: + - name: title + type: String! + - name: year + type: Int! + source: + dataConnectorName: sample_mflix + collection: eq_title + filterExpressionType: EqTitleProjectBoolExp + aggregateExpression: EqTitleProjectAggExp + orderableFields: + - fieldName: id + orderByDirections: + enableAll: true + - fieldName: bar + orderByDirections: + enableAll: true + - fieldName: foo + orderByDirections: + enableAll: true + - fieldName: title + orderByDirections: + enableAll: true + - fieldName: tomatoes + orderByDirections: + enableAll: true + - fieldName: what + orderByDirections: + enableAll: true + graphql: + selectMany: + queryRootField: eqTitle + subscription: + rootField: eqTitle + selectUniques: + - queryRootField: eqTitleById + uniqueIdentifier: + - id + subscription: + rootField: eqTitleById + argumentsInputType: EqTitleArguments + orderByExpressionType: EqTitleOrderBy + filterInputTypeName: EqTitleFilterInput + aggregate: + queryRootField: eqTitleAggregate + subscription: + rootField: eqTitleAggregate + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: EqTitle + permissions: + - role: admin + select: + filter: null + allowSubscriptions: true + diff --git a/fixtures/hasura/sample_mflix/metadata/models/ExtendedJsonTestData.hml b/fixtures/hasura/app/metadata/ExtendedJsonTestData.hml similarity index 72% rename from fixtures/hasura/sample_mflix/metadata/models/ExtendedJsonTestData.hml rename to fixtures/hasura/app/metadata/ExtendedJsonTestData.hml index 5e72c31f..2e8ccba3 100644 --- a/fixtures/hasura/sample_mflix/metadata/models/ExtendedJsonTestData.hml +++ b/fixtures/hasura/app/metadata/ExtendedJsonTestData.hml @@ -7,7 +7,7 @@ definition: - name: type type: String! - name: value - type: ExtendedJSON + type: ExtendedJson graphql: typeName: DocWithExtendedJsonValue inputTypeName: DocWithExtendedJsonValueInput @@ -31,37 +31,40 @@ definition: kind: BooleanExpressionType version: v1 definition: - name: DocWithExtendedJsonValueComparisonExp + name: DocWithExtendedJsonValueBoolExp operand: object: type: DocWithExtendedJsonValue comparableFields: - fieldName: type - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: value - booleanExpressionType: ExtendedJsonComparisonExp + booleanExpressionType: ExtendedJsonBoolExp comparableRelationships: [] logicalOperators: enable: true isNull: enable: true graphql: - typeName: DocWithExtendedJsonValueComparisonExp + typeName: DocWithExtendedJsonValueBoolExp --- kind: AggregateExpression version: v1 definition: - name: DocWithExtendedJsonValueAggregateExp + name: DocWithExtendedJsonValueAggExp operand: object: aggregatedType: DocWithExtendedJsonValue aggregatableFields: + - fieldName: type + aggregateExpression: StringAggExp - fieldName: value - aggregateExpression: ExtendedJsonAggregateExp - count: { enable: true } + aggregateExpression: ExtendedJsonAggExp + count: + enable: true graphql: - selectTypeName: DocWithExtendedJsonValueAggregateExp + selectTypeName: DocWithExtendedJsonValueAggExp --- kind: Model @@ -72,8 +75,8 @@ definition: source: dataConnectorName: sample_mflix collection: extended_json_test_data - aggregateExpression: DocWithExtendedJsonValueAggregateExp - filterExpressionType: DocWithExtendedJsonValueComparisonExp + filterExpressionType: DocWithExtendedJsonValueBoolExp + aggregateExpression: DocWithExtendedJsonValueAggExp orderableFields: - fieldName: type orderByDirections: @@ -82,13 +85,17 @@ definition: orderByDirections: enableAll: true graphql: - aggregate: - queryRootField: extendedJsonTestDataAggregate - filterInputTypeName: ExtendedJsonTestDataFilterInput selectMany: queryRootField: extendedJsonTestData + subscription: + rootField: extendedJsonTestData selectUniques: [] orderByExpressionType: ExtendedJsonTestDataOrderBy + filterInputTypeName: ExtendedJsonTestDataFilterInput + aggregate: + queryRootField: extendedJsonTestDataAggregate + subscription: + rootField: extendedJsonTestDataAggregate description: various values that all have the ExtendedJSON type --- @@ -100,4 +107,5 @@ definition: - role: admin select: filter: null + allowSubscriptions: true diff --git a/fixtures/hasura/chinook/metadata/models/Genre.hml b/fixtures/hasura/app/metadata/Genre.hml similarity index 62% rename from fixtures/hasura/chinook/metadata/models/Genre.hml rename to fixtures/hasura/app/metadata/Genre.hml index 02f85577..6f718cdb 100644 --- a/fixtures/hasura/chinook/metadata/models/Genre.hml +++ b/fixtures/hasura/app/metadata/Genre.hml @@ -5,11 +5,11 @@ definition: name: Genre fields: - name: id - type: ObjectId! + type: ObjectId_1! - name: genreId type: Int! - name: name - type: String + type: String! graphql: typeName: Genre inputTypeName: GenreInput @@ -26,7 +26,6 @@ definition: name: column: name: Name - description: Object type for collection Genre --- kind: TypePermissions @@ -45,26 +44,45 @@ definition: kind: BooleanExpressionType version: v1 definition: - name: GenreComparisonExp + name: GenreBoolExp operand: object: type: Genre comparableFields: - fieldName: id - booleanExpressionType: ObjectIdComparisonExp + booleanExpressionType: ObjectIdBoolExp_1 - fieldName: genreId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: name - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp comparableRelationships: - relationshipName: tracks - booleanExpressionType: TrackComparisonExp logicalOperators: enable: true isNull: enable: true graphql: - typeName: GenreComparisonExp + typeName: GenreBoolExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: GenreAggExp + operand: + object: + aggregatedType: Genre + aggregatableFields: + - fieldName: id + aggregateExpression: ObjectIdAggExp_1 + - fieldName: genreId + aggregateExpression: IntAggExp + - fieldName: name + aggregateExpression: StringAggExp + count: + enable: true + graphql: + selectTypeName: GenreAggExp --- kind: Model @@ -75,7 +93,8 @@ definition: source: dataConnectorName: chinook collection: Genre - filterExpressionType: GenreComparisonExp + filterExpressionType: GenreBoolExp + aggregateExpression: GenreAggExp orderableFields: - fieldName: id orderByDirections: @@ -89,11 +108,20 @@ definition: graphql: selectMany: queryRootField: genre + subscription: + rootField: genre selectUniques: - queryRootField: genreById uniqueIdentifier: - id + subscription: + rootField: genreById orderByExpressionType: GenreOrderBy + filterInputTypeName: GenreFilterInput + aggregate: + queryRootField: genreAggregate + subscription: + rootField: genreAggregate --- kind: ModelPermissions @@ -104,4 +132,5 @@ definition: - role: admin select: filter: null + allowSubscriptions: true diff --git a/fixtures/hasura/sample_mflix/metadata/commands/Hello.hml b/fixtures/hasura/app/metadata/Hello.hml similarity index 85% rename from fixtures/hasura/sample_mflix/metadata/commands/Hello.hml rename to fixtures/hasura/app/metadata/Hello.hml index b0c1cc4b..f5bc7a55 100644 --- a/fixtures/hasura/sample_mflix/metadata/commands/Hello.hml +++ b/fixtures/hasura/app/metadata/Hello.hml @@ -2,8 +2,7 @@ kind: Command version: v1 definition: - name: hello - description: Basic test of native queries + name: Hello outputType: String! arguments: - name: name @@ -12,17 +11,16 @@ definition: dataConnectorName: sample_mflix dataConnectorCommand: function: hello - argumentMapping: - name: name graphql: rootFieldName: hello rootFieldKind: Query + description: Basic test of native queries --- kind: CommandPermissions version: v1 definition: - commandName: hello + commandName: Hello permissions: - role: admin allowExecution: true diff --git a/fixtures/hasura/chinook/metadata/commands/InsertArtist.hml b/fixtures/hasura/app/metadata/InsertArtist.hml similarity index 80% rename from fixtures/hasura/chinook/metadata/commands/InsertArtist.hml rename to fixtures/hasura/app/metadata/InsertArtist.hml index 5988d7f3..f239d680 100644 --- a/fixtures/hasura/chinook/metadata/commands/InsertArtist.hml +++ b/fixtures/hasura/app/metadata/InsertArtist.hml @@ -1,9 +1,37 @@ +--- +kind: ObjectType +version: v1 +definition: + name: InsertArtist + fields: + - name: n + type: Int! + - name: ok + type: Double_1! + graphql: + typeName: InsertArtist + inputTypeName: InsertArtistInput + dataConnectorTypeMapping: + - dataConnectorName: chinook + dataConnectorObjectType: InsertArtist + +--- +kind: TypePermissions +version: v1 +definition: + typeName: InsertArtist + permissions: + - role: admin + output: + allowedFields: + - n + - ok + --- kind: Command version: v1 definition: - name: insertArtist - description: Example of a database update using a native mutation + name: InsertArtist outputType: InsertArtist! arguments: - name: id @@ -14,55 +42,17 @@ definition: dataConnectorName: chinook dataConnectorCommand: procedure: insertArtist - argumentMapping: - id: id - name: name graphql: rootFieldName: insertArtist rootFieldKind: Mutation + description: Example of a database update using a native mutation --- kind: CommandPermissions version: v1 definition: - commandName: insertArtist + commandName: InsertArtist permissions: - role: admin allowExecution: true ---- -kind: ObjectType -version: v1 -definition: - name: InsertArtist - graphql: - typeName: InsertArtist - inputTypeName: InsertArtistInput - fields: - - name: ok - type: Float! - - name: n - type: Int! - dataConnectorTypeMapping: - - dataConnectorName: chinook - dataConnectorObjectType: InsertArtist - fieldMapping: - ok: - column: - name: ok - n: - column: - name: n - ---- -kind: TypePermissions -version: v1 -definition: - typeName: InsertArtist - permissions: - - role: admin - output: - allowedFields: - - ok - - n - diff --git a/fixtures/hasura/chinook/metadata/models/Invoice.hml b/fixtures/hasura/app/metadata/Invoice.hml similarity index 68% rename from fixtures/hasura/chinook/metadata/models/Invoice.hml rename to fixtures/hasura/app/metadata/Invoice.hml index f48cdd1c..611f4faf 100644 --- a/fixtures/hasura/chinook/metadata/models/Invoice.hml +++ b/fixtures/hasura/app/metadata/Invoice.hml @@ -5,13 +5,13 @@ definition: name: Invoice fields: - name: id - type: ObjectId! + type: ObjectId_1! - name: billingAddress - type: String + type: String! - name: billingCity - type: String + type: String! - name: billingCountry - type: String + type: String! - name: billingPostalCode type: String - name: billingState @@ -61,7 +61,6 @@ definition: total: column: name: Total - description: Object type for collection Invoice --- kind: TypePermissions @@ -87,57 +86,74 @@ definition: kind: BooleanExpressionType version: v1 definition: - name: InvoiceComparisonExp + name: InvoiceBoolExp operand: object: type: Invoice comparableFields: - fieldName: id - booleanExpressionType: ObjectIdComparisonExp + booleanExpressionType: ObjectIdBoolExp_1 - fieldName: billingAddress - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: billingCity - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: billingCountry - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: billingPostalCode - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: billingState - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: customerId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: invoiceDate - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: invoiceId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: total - booleanExpressionType: DecimalComparisonExp + booleanExpressionType: DecimalBoolExp comparableRelationships: - relationshipName: customer - booleanExpressionType: CustomerComparisonExp - relationshipName: lines - booleanExpressionType: InvoiceLineComparisonExp logicalOperators: enable: true isNull: enable: true graphql: - typeName: InvoiceComparisonExp + typeName: InvoiceBoolExp --- kind: AggregateExpression version: v1 definition: - name: InvoiceAggregateExp + name: InvoiceAggExp operand: object: aggregatedType: Invoice aggregatableFields: + - fieldName: id + aggregateExpression: ObjectIdAggExp_1 + - fieldName: billingAddress + aggregateExpression: StringAggExp + - fieldName: billingCity + aggregateExpression: StringAggExp + - fieldName: billingCountry + aggregateExpression: StringAggExp + - fieldName: billingPostalCode + aggregateExpression: StringAggExp + - fieldName: billingState + aggregateExpression: StringAggExp + - fieldName: customerId + aggregateExpression: IntAggExp + - fieldName: invoiceDate + aggregateExpression: StringAggExp + - fieldName: invoiceId + aggregateExpression: IntAggExp - fieldName: total - aggregateExpression: DecimalAggregateExp - count: { enable: true } + aggregateExpression: DecimalAggExp + count: + enable: true graphql: - selectTypeName: InvoiceAggregateExp + selectTypeName: InvoiceAggExp --- kind: Model @@ -148,8 +164,8 @@ definition: source: dataConnectorName: chinook collection: Invoice - aggregateExpression: InvoiceAggregateExp - filterExpressionType: InvoiceComparisonExp + filterExpressionType: InvoiceBoolExp + aggregateExpression: InvoiceAggExp orderableFields: - fieldName: id orderByDirections: @@ -182,17 +198,22 @@ definition: orderByDirections: enableAll: true graphql: - aggregate: - queryRootField: - invoiceAggregate - filterInputTypeName: InvoiceFilterInput selectMany: queryRootField: invoice + subscription: + rootField: invoice selectUniques: - queryRootField: invoiceById uniqueIdentifier: - id + subscription: + rootField: invoiceById orderByExpressionType: InvoiceOrderBy + filterInputTypeName: InvoiceFilterInput + aggregate: + queryRootField: invoiceAggregate + subscription: + rootField: invoiceAggregate --- kind: ModelPermissions @@ -203,4 +224,5 @@ definition: - role: admin select: filter: null + allowSubscriptions: true diff --git a/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml b/fixtures/hasura/app/metadata/InvoiceLine.hml similarity index 71% rename from fixtures/hasura/chinook/metadata/models/InvoiceLine.hml rename to fixtures/hasura/app/metadata/InvoiceLine.hml index 223b5902..a6a79cdb 100644 --- a/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml +++ b/fixtures/hasura/app/metadata/InvoiceLine.hml @@ -5,7 +5,7 @@ definition: name: InvoiceLine fields: - name: id - type: ObjectId! + type: ObjectId_1! - name: invoiceId type: Int! - name: invoiceLineId @@ -41,7 +41,6 @@ definition: unitPrice: column: name: UnitPrice - description: Object type for collection InvoiceLine --- kind: TypePermissions @@ -63,51 +62,58 @@ definition: kind: BooleanExpressionType version: v1 definition: - name: InvoiceLineComparisonExp + name: InvoiceLineBoolExp operand: object: type: InvoiceLine comparableFields: - fieldName: id - booleanExpressionType: ObjectIdComparisonExp + booleanExpressionType: ObjectIdBoolExp_1 - fieldName: invoiceId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: invoiceLineId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: quantity - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: trackId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: unitPrice - booleanExpressionType: DecimalComparisonExp + booleanExpressionType: DecimalBoolExp comparableRelationships: - relationshipName: invoice - booleanExpressionType: InvoiceComparisonExp - relationshipName: track - booleanExpressionType: TrackComparisonExp logicalOperators: enable: true isNull: enable: true graphql: - typeName: InvoiceLineComparisonExp + typeName: InvoiceLineBoolExp --- kind: AggregateExpression version: v1 definition: - name: InvoiceLineAggregateExp + name: InvoiceLineAggExp operand: object: aggregatedType: InvoiceLine aggregatableFields: + - fieldName: id + aggregateExpression: ObjectIdAggExp_1 + - fieldName: invoiceId + aggregateExpression: IntAggExp + - fieldName: invoiceLineId + aggregateExpression: IntAggExp - fieldName: quantity - aggregateExpression: IntAggregateExp + aggregateExpression: IntAggExp + - fieldName: trackId + aggregateExpression: IntAggExp - fieldName: unitPrice - aggregateExpression: DecimalAggregateExp - count: { enable: true } + aggregateExpression: DecimalAggExp + count: + enable: true graphql: - selectTypeName: InvoiceLineAggregateExp + selectTypeName: InvoiceLineAggExp --- kind: Model @@ -118,8 +124,8 @@ definition: source: dataConnectorName: chinook collection: InvoiceLine - aggregateExpression: InvoiceLineAggregateExp - filterExpressionType: InvoiceLineComparisonExp + filterExpressionType: InvoiceLineBoolExp + aggregateExpression: InvoiceLineAggExp orderableFields: - fieldName: id orderByDirections: @@ -140,17 +146,22 @@ definition: orderByDirections: enableAll: true graphql: - aggregate: - queryRootField: - invoiceLineAggregate - filterInputTypeName: InvoiceLineFilterInput selectMany: queryRootField: invoiceLine + subscription: + rootField: invoiceLine selectUniques: - queryRootField: invoiceLineById uniqueIdentifier: - id + subscription: + rootField: invoiceLineById orderByExpressionType: InvoiceLineOrderBy + filterInputTypeName: InvoiceLineFilterInput + aggregate: + queryRootField: invoiceLineAggregate + subscription: + rootField: invoiceLineAggregate --- kind: ModelPermissions @@ -161,4 +172,5 @@ definition: - role: admin select: filter: null + allowSubscriptions: true diff --git a/fixtures/hasura/chinook/metadata/models/MediaType.hml b/fixtures/hasura/app/metadata/MediaType.hml similarity index 62% rename from fixtures/hasura/chinook/metadata/models/MediaType.hml rename to fixtures/hasura/app/metadata/MediaType.hml index 31d1153f..fc2ab999 100644 --- a/fixtures/hasura/chinook/metadata/models/MediaType.hml +++ b/fixtures/hasura/app/metadata/MediaType.hml @@ -5,11 +5,11 @@ definition: name: MediaType fields: - name: id - type: ObjectId! + type: ObjectId_1! - name: mediaTypeId type: Int! - name: name - type: String + type: String! graphql: typeName: MediaType inputTypeName: MediaTypeInput @@ -26,7 +26,6 @@ definition: name: column: name: Name - description: Object type for collection MediaType --- kind: TypePermissions @@ -45,26 +44,45 @@ definition: kind: BooleanExpressionType version: v1 definition: - name: MediaTypeComparisonExp + name: MediaTypeBoolExp operand: object: type: MediaType comparableFields: - fieldName: id - booleanExpressionType: ObjectIdComparisonExp + booleanExpressionType: ObjectIdBoolExp_1 - fieldName: mediaTypeId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: name - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp comparableRelationships: - relationshipName: tracks - booleanExpressionType: TrackComparisonExp logicalOperators: enable: true isNull: enable: true graphql: - typeName: MediaTypeComparisonExp + typeName: MediaTypeBoolExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: MediaTypeAggExp + operand: + object: + aggregatedType: MediaType + aggregatableFields: + - fieldName: id + aggregateExpression: ObjectIdAggExp_1 + - fieldName: mediaTypeId + aggregateExpression: IntAggExp + - fieldName: name + aggregateExpression: StringAggExp + count: + enable: true + graphql: + selectTypeName: MediaTypeAggExp --- kind: Model @@ -75,7 +93,8 @@ definition: source: dataConnectorName: chinook collection: MediaType - filterExpressionType: MediaTypeComparisonExp + filterExpressionType: MediaTypeBoolExp + aggregateExpression: MediaTypeAggExp orderableFields: - fieldName: id orderByDirections: @@ -89,11 +108,20 @@ definition: graphql: selectMany: queryRootField: mediaType + subscription: + rootField: mediaType selectUniques: - queryRootField: mediaTypeById uniqueIdentifier: - id + subscription: + rootField: mediaTypeById orderByExpressionType: MediaTypeOrderBy + filterInputTypeName: MediaTypeFilterInput + aggregate: + queryRootField: mediaTypeAggregate + subscription: + rootField: mediaTypeAggregate --- kind: ModelPermissions @@ -104,4 +132,5 @@ definition: - role: admin select: filter: null + allowSubscriptions: true diff --git a/fixtures/hasura/sample_mflix/metadata/models/Movies.hml b/fixtures/hasura/app/metadata/Movies.hml similarity index 65% rename from fixtures/hasura/sample_mflix/metadata/models/Movies.hml rename to fixtures/hasura/app/metadata/Movies.hml index b251029c..263beda9 100644 --- a/fixtures/hasura/sample_mflix/metadata/models/Movies.hml +++ b/fixtures/hasura/app/metadata/Movies.hml @@ -30,46 +30,6 @@ definition: - text - wins ---- -kind: BooleanExpressionType -version: v1 -definition: - name: MoviesAwardsComparisonExp - operand: - object: - type: MoviesAwards - comparableFields: - - fieldName: nominations - booleanExpressionType: IntComparisonExp - - fieldName: text - booleanExpressionType: StringComparisonExp - - fieldName: wins - booleanExpressionType: IntComparisonExp - comparableRelationships: [] - logicalOperators: - enable: true - isNull: - enable: true - graphql: - typeName: MoviesAwardsComparisonExp - ---- -kind: AggregateExpression -version: v1 -definition: - name: MoviesAwardsAggregateExp - operand: - object: - aggregatedType: MoviesAwards - aggregatableFields: - - fieldName: nominations - aggregateExpression: IntAggregateExp - - fieldName: wins - aggregateExpression: IntAggregateExp - count: { enable: true } - graphql: - selectTypeName: MoviesAwardsAggregateExp - --- kind: ObjectType version: v1 @@ -79,7 +39,7 @@ definition: - name: id type: Int! - name: rating - type: Float! + type: Double! - name: votes type: Int! graphql: @@ -102,46 +62,6 @@ definition: - rating - votes ---- -kind: BooleanExpressionType -version: v1 -definition: - name: MoviesImdbComparisonExp - operand: - object: - type: MoviesImdb - comparableFields: - - fieldName: id - booleanExpressionType: IntComparisonExp - - fieldName: rating - booleanExpressionType: FloatComparisonExp - - fieldName: votes - booleanExpressionType: IntComparisonExp - comparableRelationships: [] - logicalOperators: - enable: true - isNull: - enable: true - graphql: - typeName: MoviesImdbComparisonExp - ---- -kind: AggregateExpression -version: v1 -definition: - name: MoviesImdbAggregateExp - operand: - object: - aggregatedType: MoviesImdb - aggregatableFields: - - fieldName: rating - aggregateExpression: FloatAggregateExp - - fieldName: votes - aggregateExpression: IntAggregateExp - count: { enable: true } - graphql: - selectTypeName: MoviesImdbAggregateExp - --- kind: ObjectType version: v1 @@ -151,9 +71,9 @@ definition: - name: meter type: Int! - name: numReviews - type: Int! + type: Int - name: rating - type: Float! + type: Double graphql: typeName: MoviesTomatoesCritic inputTypeName: MoviesTomatoesCriticInput @@ -174,48 +94,6 @@ definition: - numReviews - rating ---- -kind: BooleanExpressionType -version: v1 -definition: - name: MoviesTomatoesCriticComparisonExp - operand: - object: - type: MoviesTomatoesCritic - comparableFields: - - fieldName: meter - booleanExpressionType: IntComparisonExp - - fieldName: numReviews - booleanExpressionType: IntComparisonExp - - fieldName: rating - booleanExpressionType: FloatComparisonExp - comparableRelationships: [] - logicalOperators: - enable: true - isNull: - enable: true - graphql: - typeName: MoviesTomatoesCriticComparisonExp - ---- -kind: AggregateExpression -version: v1 -definition: - name: MoviesTomatoesCriticAggregateExp - operand: - object: - aggregatedType: MoviesTomatoesCritic - aggregatableFields: - - fieldName: meter - aggregateExpression: IntAggregateExp - - fieldName: numReviews - aggregateExpression: IntAggregateExp - - fieldName: rating - aggregateExpression: FloatAggregateExp - count: { enable: true } - graphql: - selectTypeName: MoviesTomatoesCriticAggregateExp - --- kind: ObjectType version: v1 @@ -227,7 +105,7 @@ definition: - name: numReviews type: Int! - name: rating - type: Float! + type: Double graphql: typeName: MoviesTomatoesViewer inputTypeName: MoviesTomatoesViewerInput @@ -248,48 +126,6 @@ definition: - numReviews - rating ---- -kind: BooleanExpressionType -version: v1 -definition: - name: MoviesTomatoesViewerComparisonExp - operand: - object: - type: MoviesTomatoesViewer - comparableFields: - - fieldName: meter - booleanExpressionType: IntComparisonExp - - fieldName: numReviews - booleanExpressionType: IntComparisonExp - - fieldName: rating - booleanExpressionType: FloatComparisonExp - comparableRelationships: [] - logicalOperators: - enable: true - isNull: - enable: true - graphql: - typeName: MoviesTomatoesViewerComparisonExp - ---- -kind: AggregateExpression -version: v1 -definition: - name: MoviesTomatoesViewerAggregateExp - operand: - object: - aggregatedType: MoviesTomatoesViewer - aggregatableFields: - - fieldName: meter - aggregateExpression: IntAggregateExp - - fieldName: numReviews - aggregateExpression: IntAggregateExp - - fieldName: rating - aggregateExpression: FloatAggregateExp - count: { enable: true } - graphql: - selectTypeName: MoviesTomatoesViewerAggregateExp - --- kind: ObjectType version: v1 @@ -343,68 +179,6 @@ definition: - viewer - website ---- -kind: BooleanExpressionType -version: v1 -definition: - name: MoviesTomatoesComparisonExp - operand: - object: - type: MoviesTomatoes - comparableFields: - - fieldName: boxOffice - booleanExpressionType: StringComparisonExp - - fieldName: consensus - booleanExpressionType: StringComparisonExp - - fieldName: critic - booleanExpressionType: MoviesTomatoesCriticComparisonExp - - fieldName: dvd - booleanExpressionType: DateComparisonExp - - fieldName: fresh - booleanExpressionType: IntComparisonExp - - fieldName: lastUpdated - booleanExpressionType: DateComparisonExp - - fieldName: production - booleanExpressionType: StringComparisonExp - - fieldName: rotten - booleanExpressionType: IntComparisonExp - - fieldName: viewer - booleanExpressionType: MoviesTomatoesViewerComparisonExp - - fieldName: website - booleanExpressionType: StringComparisonExp - comparableRelationships: [] - logicalOperators: - enable: true - isNull: - enable: true - graphql: - typeName: MoviesTomatoesComparisonExp - ---- -kind: AggregateExpression -version: v1 -definition: - name: MoviesTomatoesAggregateExp - operand: - object: - aggregatedType: MoviesTomatoes - aggregatableFields: - - fieldName: critic - aggregateExpression: MoviesTomatoesCriticAggregateExp - - fieldName: dvd - aggregateExpression: DateAggregateExp - - fieldName: fresh - aggregateExpression: IntAggregateExp - - fieldName: lastUpdated - aggregateExpression: DateAggregateExp - - fieldName: rotten - aggregateExpression: IntAggregateExp - - fieldName: viewer - aggregateExpression: MoviesTomatoesViewerAggregateExp - count: { enable: true } - graphql: - selectTypeName: MoviesTomatoesAggregateExp - --- kind: ObjectType version: v1 @@ -420,11 +194,11 @@ definition: - name: countries type: "[String!]!" - name: directors - type: "[String!]!" + type: "[String!]" - name: fullplot type: String - name: genres - type: "[String!]!" + type: "[String!]" - name: imdb type: MoviesImdb! - name: languages @@ -565,87 +339,220 @@ definition: kind: BooleanExpressionType version: v1 definition: - name: MoviesComparisonExp + name: MoviesAwardsBoolExp + operand: + object: + type: MoviesAwards + comparableFields: + - fieldName: nominations + booleanExpressionType: IntBoolExp + - fieldName: text + booleanExpressionType: StringBoolExp + - fieldName: wins + booleanExpressionType: IntBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: MoviesAwardsBoolExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: MoviesImdbBoolExp + operand: + object: + type: MoviesImdb + comparableFields: + - fieldName: id + booleanExpressionType: IntBoolExp + - fieldName: rating + booleanExpressionType: DoubleBoolExp + - fieldName: votes + booleanExpressionType: IntBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: MoviesImdbBoolExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: MoviesTomatoesCriticBoolExp + operand: + object: + type: MoviesTomatoesCritic + comparableFields: + - fieldName: meter + booleanExpressionType: IntBoolExp + - fieldName: numReviews + booleanExpressionType: IntBoolExp + - fieldName: rating + booleanExpressionType: DoubleBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: MoviesTomatoesCriticBoolExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: MoviesTomatoesViewerBoolExp + operand: + object: + type: MoviesTomatoesViewer + comparableFields: + - fieldName: meter + booleanExpressionType: IntBoolExp + - fieldName: numReviews + booleanExpressionType: IntBoolExp + - fieldName: rating + booleanExpressionType: DoubleBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: MoviesTomatoesViewerBoolExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: MoviesTomatoesBoolExp + operand: + object: + type: MoviesTomatoes + comparableFields: + - fieldName: boxOffice + booleanExpressionType: StringBoolExp + - fieldName: consensus + booleanExpressionType: StringBoolExp + - fieldName: critic + booleanExpressionType: MoviesTomatoesCriticBoolExp + - fieldName: dvd + booleanExpressionType: DateBoolExp + - fieldName: fresh + booleanExpressionType: IntBoolExp + - fieldName: lastUpdated + booleanExpressionType: DateBoolExp + - fieldName: production + booleanExpressionType: StringBoolExp + - fieldName: rotten + booleanExpressionType: IntBoolExp + - fieldName: viewer + booleanExpressionType: MoviesTomatoesViewerBoolExp + - fieldName: website + booleanExpressionType: StringBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: MoviesTomatoesBoolExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: MoviesBoolExp operand: object: type: Movies comparableFields: - fieldName: id - booleanExpressionType: ObjectIdComparisonExp + booleanExpressionType: ObjectIdBoolExp - fieldName: awards - booleanExpressionType: MoviesAwardsComparisonExp - - fieldName: cast - booleanExpressionType: StringComparisonExp + booleanExpressionType: MoviesAwardsBoolExp - fieldName: fullplot - booleanExpressionType: StringComparisonExp - - fieldName: genres - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: imdb - booleanExpressionType: MoviesImdbComparisonExp + booleanExpressionType: MoviesImdbBoolExp - fieldName: lastupdated - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: metacritic - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: numMflixComments - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: plot - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: poster - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: rated - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: released - booleanExpressionType: DateComparisonExp + booleanExpressionType: DateBoolExp - fieldName: runtime - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: title - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: tomatoes - booleanExpressionType: MoviesTomatoesComparisonExp + booleanExpressionType: MoviesTomatoesBoolExp - fieldName: type - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: year - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp comparableRelationships: - relationshipName: comments - booleanExpressionType: CommentsComparisonExp logicalOperators: enable: true isNull: enable: true graphql: - typeName: MoviesComparisonExp + typeName: MoviesBoolExp --- kind: AggregateExpression version: v1 definition: - name: MoviesAggregateExp + name: MoviesAggExp operand: object: aggregatedType: Movies aggregatableFields: - # TODO: This requires updating the connector to support nested field - # aggregates - # - fieldName: awards - # aggregateExpression: MoviesAwardsAggregateExp - # - fieldName: imdb - # aggregateExpression: MoviesImdbAggregateExp + - fieldName: id + aggregateExpression: ObjectIdAggExp + - fieldName: fullplot + aggregateExpression: StringAggExp + - fieldName: lastupdated + aggregateExpression: StringAggExp - fieldName: metacritic - aggregateExpression: IntAggregateExp + aggregateExpression: IntAggExp - fieldName: numMflixComments - aggregateExpression: IntAggregateExp + aggregateExpression: IntAggExp + - fieldName: plot + aggregateExpression: StringAggExp + - fieldName: poster + aggregateExpression: StringAggExp + - fieldName: rated + aggregateExpression: StringAggExp - fieldName: released - aggregateExpression: DateAggregateExp + aggregateExpression: DateAggExp - fieldName: runtime - aggregateExpression: IntAggregateExp - # - fieldName: tomatoes - # aggregateExpression: MoviesTomatoesAggregateExp + aggregateExpression: IntAggExp + - fieldName: title + aggregateExpression: StringAggExp + - fieldName: type + aggregateExpression: StringAggExp - fieldName: year - aggregateExpression: IntAggregateExp - count: { enable: true } + aggregateExpression: IntAggExp + count: + enable: true graphql: - selectTypeName: MoviesAggregateExp + selectTypeName: MoviesAggExp --- kind: Model @@ -656,8 +563,8 @@ definition: source: dataConnectorName: sample_mflix collection: movies - aggregateExpression: MoviesAggregateExp - filterExpressionType: MoviesComparisonExp + filterExpressionType: MoviesBoolExp + aggregateExpression: MoviesAggExp orderableFields: - fieldName: id orderByDirections: @@ -726,16 +633,22 @@ definition: orderByDirections: enableAll: true graphql: - aggregate: - queryRootField: moviesAggregate - filterInputTypeName: MoviesFilterInput selectMany: queryRootField: movies + subscription: + rootField: movies selectUniques: - queryRootField: moviesById uniqueIdentifier: - id + subscription: + rootField: moviesById orderByExpressionType: MoviesOrderBy + filterInputTypeName: MoviesFilterInput + aggregate: + queryRootField: moviesAggregate + subscription: + rootField: moviesAggregate --- kind: ModelPermissions @@ -746,3 +659,5 @@ definition: - role: admin select: filter: null + allowSubscriptions: true + diff --git a/fixtures/hasura/app/metadata/NativeQuery.hml b/fixtures/hasura/app/metadata/NativeQuery.hml new file mode 100644 index 00000000..c25807b4 --- /dev/null +++ b/fixtures/hasura/app/metadata/NativeQuery.hml @@ -0,0 +1,350 @@ +--- +kind: ObjectType +version: v1 +definition: + name: NativeQueryProjectBar + fields: + - name: foo + type: MoviesImdb! + graphql: + typeName: NativeQueryProjectBar + inputTypeName: NativeQueryProjectBarInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: native_query_project_bar + +--- +kind: TypePermissions +version: v1 +definition: + typeName: NativeQueryProjectBar + permissions: + - role: admin + output: + allowedFields: + - foo + +--- +kind: ObjectType +version: v1 +definition: + name: NativeQueryProjectFoo + fields: + - name: bar + type: MoviesTomatoesCritic + graphql: + typeName: NativeQueryProjectFoo + inputTypeName: NativeQueryProjectFooInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: native_query_project_foo + +--- +kind: TypePermissions +version: v1 +definition: + typeName: NativeQueryProjectFoo + permissions: + - role: admin + output: + allowedFields: + - bar + +--- +kind: ObjectType +version: v1 +definition: + name: NativeQueryProjectWhatThe + fields: + - name: heck + type: String! + graphql: + typeName: NativeQueryProjectWhatThe + inputTypeName: NativeQueryProjectWhatTheInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: native_query_project_what_the + +--- +kind: TypePermissions +version: v1 +definition: + typeName: NativeQueryProjectWhatThe + permissions: + - role: admin + output: + allowedFields: + - heck + +--- +kind: ObjectType +version: v1 +definition: + name: NativeQueryProjectWhat + fields: + - name: the + type: NativeQueryProjectWhatThe! + graphql: + typeName: NativeQueryProjectWhat + inputTypeName: NativeQueryProjectWhatInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: native_query_project_what + +--- +kind: TypePermissions +version: v1 +definition: + typeName: NativeQueryProjectWhat + permissions: + - role: admin + output: + allowedFields: + - the + +--- +kind: ObjectType +version: v1 +definition: + name: NativeQueryProject + fields: + - name: id + type: ObjectId! + - name: bar + type: NativeQueryProjectBar! + - name: foo + type: NativeQueryProjectFoo! + - name: title + type: String! + - name: tomatoes + type: MoviesTomatoes + - name: what + type: NativeQueryProjectWhat! + graphql: + typeName: NativeQueryProject + inputTypeName: NativeQueryProjectInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: native_query_project + fieldMapping: + id: + column: + name: _id + bar: + column: + name: bar + foo: + column: + name: foo + title: + column: + name: title + tomatoes: + column: + name: tomatoes + what: + column: + name: what + +--- +kind: TypePermissions +version: v1 +definition: + typeName: NativeQueryProject + permissions: + - role: admin + output: + allowedFields: + - id + - bar + - foo + - title + - tomatoes + - what + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: NativeQueryProjectBarBoolExp + operand: + object: + type: NativeQueryProjectBar + comparableFields: + - fieldName: foo + booleanExpressionType: MoviesImdbBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: NativeQueryProjectBarBoolExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: NativeQueryProjectFooBoolExp + operand: + object: + type: NativeQueryProjectFoo + comparableFields: + - fieldName: bar + booleanExpressionType: MoviesTomatoesCriticBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: NativeQueryProjectFooBoolExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: NativeQueryProjectWhatTheBoolExp + operand: + object: + type: NativeQueryProjectWhatThe + comparableFields: + - fieldName: heck + booleanExpressionType: StringBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: NativeQueryProjectWhatTheBoolExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: NativeQueryProjectWhatBoolExp + operand: + object: + type: NativeQueryProjectWhat + comparableFields: + - fieldName: the + booleanExpressionType: NativeQueryProjectWhatTheBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: NativeQueryProjectWhatBoolExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: NativeQueryProjectBoolExp + operand: + object: + type: NativeQueryProject + comparableFields: + - fieldName: id + booleanExpressionType: ObjectIdBoolExp + - fieldName: bar + booleanExpressionType: NativeQueryProjectBarBoolExp + - fieldName: foo + booleanExpressionType: NativeQueryProjectFooBoolExp + - fieldName: title + booleanExpressionType: StringBoolExp + - fieldName: tomatoes + booleanExpressionType: MoviesTomatoesBoolExp + - fieldName: what + booleanExpressionType: NativeQueryProjectWhatBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: NativeQueryProjectBoolExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: NativeQueryProjectAggExp + operand: + object: + aggregatedType: NativeQueryProject + aggregatableFields: + - fieldName: id + aggregateExpression: ObjectIdAggExp + - fieldName: title + aggregateExpression: StringAggExp + count: + enable: true + graphql: + selectTypeName: NativeQueryProjectAggExp + +--- +kind: Model +version: v1 +definition: + name: NativeQuery + objectType: NativeQueryProject + arguments: + - name: title + type: String! + source: + dataConnectorName: sample_mflix + collection: native_query + filterExpressionType: NativeQueryProjectBoolExp + aggregateExpression: NativeQueryProjectAggExp + orderableFields: + - fieldName: id + orderByDirections: + enableAll: true + - fieldName: bar + orderByDirections: + enableAll: true + - fieldName: foo + orderByDirections: + enableAll: true + - fieldName: title + orderByDirections: + enableAll: true + - fieldName: tomatoes + orderByDirections: + enableAll: true + - fieldName: what + orderByDirections: + enableAll: true + graphql: + selectMany: + queryRootField: nativeQuery + subscription: + rootField: nativeQuery + selectUniques: + - queryRootField: nativeQueryById + uniqueIdentifier: + - id + subscription: + rootField: nativeQueryById + argumentsInputType: NativeQueryArguments + orderByExpressionType: NativeQueryOrderBy + filterInputTypeName: NativeQueryFilterInput + aggregate: + queryRootField: nativeQueryAggregate + subscription: + rootField: nativeQueryAggregate + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: NativeQuery + permissions: + - role: admin + select: + filter: null + allowSubscriptions: true + diff --git a/fixtures/hasura/test_cases/metadata/models/NestedCollection.hml b/fixtures/hasura/app/metadata/NestedCollection.hml similarity index 61% rename from fixtures/hasura/test_cases/metadata/models/NestedCollection.hml rename to fixtures/hasura/app/metadata/NestedCollection.hml index 121fa6df..4923afb9 100644 --- a/fixtures/hasura/test_cases/metadata/models/NestedCollection.hml +++ b/fixtures/hasura/app/metadata/NestedCollection.hml @@ -7,32 +7,12 @@ definition: - name: name type: String! graphql: - typeName: TestCases_NestedCollectionStaff - inputTypeName: TestCases_NestedCollectionStaffInput + typeName: NestedCollectionStaff + inputTypeName: NestedCollectionStaffInput dataConnectorTypeMapping: - dataConnectorName: test_cases dataConnectorObjectType: nested_collection_staff ---- -kind: BooleanExpressionType -version: v1 -definition: - name: NestedCollectionStaffComparisonExp - operand: - object: - type: NestedCollectionStaff - comparableFields: - - fieldName: name - booleanExpressionType: StringComparisonExp - comparableRelationships: [] - logicalOperators: - enable: true - isNull: - enable: true - graphql: - typeName: TestCases_NestedCollectionStaffComparisonExp - - --- kind: TypePermissions version: v1 @@ -51,14 +31,14 @@ definition: name: NestedCollection fields: - name: id - type: ObjectId! + type: ObjectId_2! - name: institution type: String! - name: staff type: "[NestedCollectionStaff!]!" graphql: - typeName: TestCases_NestedCollection - inputTypeName: TestCases_NestedCollectionInput + typeName: NestedCollection + inputTypeName: NestedCollectionInput dataConnectorTypeMapping: - dataConnectorName: test_cases dataConnectorObjectType: nested_collection @@ -90,24 +70,61 @@ definition: kind: BooleanExpressionType version: v1 definition: - name: NestedCollectionComparisonExp + name: NestedCollectionStaffBoolExp + operand: + object: + type: NestedCollectionStaff + comparableFields: + - fieldName: name + booleanExpressionType: StringBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: NestedCollectionStaffBoolExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: NestedCollectionBoolExp operand: object: type: NestedCollection comparableFields: - fieldName: id - booleanExpressionType: ObjectIdComparisonExp + booleanExpressionType: ObjectIdBoolExp_2 - fieldName: institution - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: staff - booleanExpressionType: NestedCollectionStaffComparisonExp + booleanExpressionType: NestedCollectionStaffBoolExp comparableRelationships: [] logicalOperators: enable: true isNull: enable: true graphql: - typeName: TestCases_NestedCollectionComparisonExp + typeName: NestedCollectionBoolExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: NestedCollectionAggExp + operand: + object: + aggregatedType: NestedCollection + aggregatableFields: + - fieldName: id + aggregateExpression: ObjectIdAggExp_2 + - fieldName: institution + aggregateExpression: StringAggExp + count: + enable: true + graphql: + selectTypeName: NestedCollectionAggExp --- kind: Model @@ -118,7 +135,8 @@ definition: source: dataConnectorName: test_cases collection: nested_collection - filterExpressionType: NestedCollectionComparisonExp + filterExpressionType: NestedCollectionBoolExp + aggregateExpression: NestedCollectionAggExp orderableFields: - fieldName: id orderByDirections: @@ -131,12 +149,21 @@ definition: enableAll: true graphql: selectMany: - queryRootField: testCases_nestedCollection + queryRootField: nestedCollection + subscription: + rootField: nestedCollection selectUniques: - - queryRootField: testCases_nestedCollectionById + - queryRootField: nestedCollectionById uniqueIdentifier: - id - orderByExpressionType: TestCases_NestedCollectionOrderBy + subscription: + rootField: nestedCollectionById + orderByExpressionType: NestedCollectionOrderBy + filterInputTypeName: NestedCollectionFilterInput + aggregate: + queryRootField: nestedCollectionAggregate + subscription: + rootField: nestedCollectionAggregate --- kind: ModelPermissions @@ -147,4 +174,5 @@ definition: - role: admin select: filter: null + allowSubscriptions: true diff --git a/fixtures/hasura/test_cases/metadata/models/NestedFieldWithDollar.hml b/fixtures/hasura/app/metadata/NestedFieldWithDollar.hml similarity index 52% rename from fixtures/hasura/test_cases/metadata/models/NestedFieldWithDollar.hml rename to fixtures/hasura/app/metadata/NestedFieldWithDollar.hml index bd68d68b..b1ca6f75 100644 --- a/fixtures/hasura/test_cases/metadata/models/NestedFieldWithDollar.hml +++ b/fixtures/hasura/app/metadata/NestedFieldWithDollar.hml @@ -7,8 +7,8 @@ definition: - name: schema type: String graphql: - typeName: TestCases_NestedFieldWithDollarConfiguration - inputTypeName: TestCases_NestedFieldWithDollarConfigurationInput + typeName: NestedFieldWithDollarConfiguration + inputTypeName: NestedFieldWithDollarConfigurationInput dataConnectorTypeMapping: - dataConnectorName: test_cases dataConnectorObjectType: nested_field_with_dollar_configuration @@ -35,12 +35,12 @@ definition: name: NestedFieldWithDollar fields: - name: id - type: ObjectId! + type: ObjectId_2! - name: configuration type: NestedFieldWithDollarConfiguration! graphql: - typeName: TestCases_NestedFieldWithDollar - inputTypeName: TestCases_NestedFieldWithDollarInput + typeName: NestedFieldWithDollar + inputTypeName: NestedFieldWithDollarInput dataConnectorTypeMapping: - dataConnectorName: test_cases dataConnectorObjectType: nested_field_with_dollar @@ -68,20 +68,57 @@ definition: kind: BooleanExpressionType version: v1 definition: - name: NestedFieldWithDollarComparisonExp + name: NestedFieldWithDollarConfigurationBoolExp + operand: + object: + type: NestedFieldWithDollarConfiguration + comparableFields: + - fieldName: schema + booleanExpressionType: StringBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: NestedFieldWithDollarConfigurationBoolExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: NestedFieldWithDollarBoolExp operand: object: type: NestedFieldWithDollar comparableFields: - fieldName: id - booleanExpressionType: ObjectIdComparisonExp + booleanExpressionType: ObjectIdBoolExp_2 + - fieldName: configuration + booleanExpressionType: NestedFieldWithDollarConfigurationBoolExp comparableRelationships: [] logicalOperators: enable: true isNull: enable: true graphql: - typeName: TestCases_NestedFieldWithDollarComparisonExp + typeName: NestedFieldWithDollarBoolExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: NestedFieldWithDollarAggExp + operand: + object: + aggregatedType: NestedFieldWithDollar + aggregatableFields: + - fieldName: id + aggregateExpression: ObjectIdAggExp_2 + count: + enable: true + graphql: + selectTypeName: NestedFieldWithDollarAggExp --- kind: Model @@ -92,7 +129,8 @@ definition: source: dataConnectorName: test_cases collection: nested_field_with_dollar - filterExpressionType: NestedFieldWithDollarComparisonExp + filterExpressionType: NestedFieldWithDollarBoolExp + aggregateExpression: NestedFieldWithDollarAggExp orderableFields: - fieldName: id orderByDirections: @@ -102,12 +140,21 @@ definition: enableAll: true graphql: selectMany: - queryRootField: testCases_nestedFieldWithDollar + queryRootField: nestedFieldWithDollar + subscription: + rootField: nestedFieldWithDollar selectUniques: - - queryRootField: testCases_nestedFieldWithDollarById + - queryRootField: nestedFieldWithDollarById uniqueIdentifier: - id - orderByExpressionType: TestCases_NestedFieldWithDollarOrderBy + subscription: + rootField: nestedFieldWithDollarById + orderByExpressionType: NestedFieldWithDollarOrderBy + filterInputTypeName: NestedFieldWithDollarFilterInput + aggregate: + queryRootField: nestedFieldWithDollarAggregate + subscription: + rootField: nestedFieldWithDollarAggregate --- kind: ModelPermissions @@ -118,4 +165,5 @@ definition: - role: admin select: filter: null + allowSubscriptions: true diff --git a/fixtures/hasura/chinook/metadata/models/Playlist.hml b/fixtures/hasura/app/metadata/Playlist.hml similarity index 62% rename from fixtures/hasura/chinook/metadata/models/Playlist.hml rename to fixtures/hasura/app/metadata/Playlist.hml index b385a502..3fcf6bea 100644 --- a/fixtures/hasura/chinook/metadata/models/Playlist.hml +++ b/fixtures/hasura/app/metadata/Playlist.hml @@ -5,9 +5,9 @@ definition: name: Playlist fields: - name: id - type: ObjectId! + type: ObjectId_1! - name: name - type: String + type: String! - name: playlistId type: Int! graphql: @@ -26,7 +26,6 @@ definition: playlistId: column: name: PlaylistId - description: Object type for collection Playlist --- kind: TypePermissions @@ -45,26 +44,45 @@ definition: kind: BooleanExpressionType version: v1 definition: - name: PlaylistComparisonExp + name: PlaylistBoolExp operand: object: type: Playlist comparableFields: - fieldName: id - booleanExpressionType: ObjectIdComparisonExp + booleanExpressionType: ObjectIdBoolExp_1 - fieldName: name - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: playlistId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp comparableRelationships: - relationshipName: playlistTracks - booleanExpressionType: TrackComparisonExp logicalOperators: enable: true isNull: enable: true graphql: - typeName: PlaylistComparisonExp + typeName: PlaylistBoolExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: PlaylistAggExp + operand: + object: + aggregatedType: Playlist + aggregatableFields: + - fieldName: id + aggregateExpression: ObjectIdAggExp_1 + - fieldName: name + aggregateExpression: StringAggExp + - fieldName: playlistId + aggregateExpression: IntAggExp + count: + enable: true + graphql: + selectTypeName: PlaylistAggExp --- kind: Model @@ -75,7 +93,8 @@ definition: source: dataConnectorName: chinook collection: Playlist - filterExpressionType: PlaylistComparisonExp + filterExpressionType: PlaylistBoolExp + aggregateExpression: PlaylistAggExp orderableFields: - fieldName: id orderByDirections: @@ -89,11 +108,20 @@ definition: graphql: selectMany: queryRootField: playlist + subscription: + rootField: playlist selectUniques: - queryRootField: playlistById uniqueIdentifier: - id + subscription: + rootField: playlistById orderByExpressionType: PlaylistOrderBy + filterInputTypeName: PlaylistFilterInput + aggregate: + queryRootField: playlistAggregate + subscription: + rootField: playlistAggregate --- kind: ModelPermissions @@ -104,4 +132,5 @@ definition: - role: admin select: filter: null + allowSubscriptions: true diff --git a/fixtures/hasura/chinook/metadata/models/PlaylistTrack.hml b/fixtures/hasura/app/metadata/PlaylistTrack.hml similarity index 63% rename from fixtures/hasura/chinook/metadata/models/PlaylistTrack.hml rename to fixtures/hasura/app/metadata/PlaylistTrack.hml index 6d4107c0..02c4d289 100644 --- a/fixtures/hasura/chinook/metadata/models/PlaylistTrack.hml +++ b/fixtures/hasura/app/metadata/PlaylistTrack.hml @@ -5,7 +5,7 @@ definition: name: PlaylistTrack fields: - name: id - type: ObjectId! + type: ObjectId_1! - name: playlistId type: Int! - name: trackId @@ -26,7 +26,6 @@ definition: trackId: column: name: TrackId - description: Object type for collection PlaylistTrack --- kind: TypePermissions @@ -45,28 +44,46 @@ definition: kind: BooleanExpressionType version: v1 definition: - name: PlaylistTrackComparisonExp + name: PlaylistTrackBoolExp operand: object: type: PlaylistTrack comparableFields: - fieldName: id - booleanExpressionType: ObjectIdComparisonExp + booleanExpressionType: ObjectIdBoolExp_1 - fieldName: playlistId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: trackId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp comparableRelationships: - relationshipName: playlist - booleanExpressionType: PlaylistComparisonExp - relationshipName: track - booleanExpressionType: TrackComparisonExp logicalOperators: enable: true isNull: enable: true graphql: - typeName: PlaylistTrackComparisonExp + typeName: PlaylistTrackBoolExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: PlaylistTrackAggExp + operand: + object: + aggregatedType: PlaylistTrack + aggregatableFields: + - fieldName: id + aggregateExpression: ObjectIdAggExp_1 + - fieldName: playlistId + aggregateExpression: IntAggExp + - fieldName: trackId + aggregateExpression: IntAggExp + count: + enable: true + graphql: + selectTypeName: PlaylistTrackAggExp --- kind: Model @@ -77,7 +94,8 @@ definition: source: dataConnectorName: chinook collection: PlaylistTrack - filterExpressionType: PlaylistTrackComparisonExp + filterExpressionType: PlaylistTrackBoolExp + aggregateExpression: PlaylistTrackAggExp orderableFields: - fieldName: id orderByDirections: @@ -91,11 +109,20 @@ definition: graphql: selectMany: queryRootField: playlistTrack + subscription: + rootField: playlistTrack selectUniques: - queryRootField: playlistTrackById uniqueIdentifier: - id + subscription: + rootField: playlistTrackById orderByExpressionType: PlaylistTrackOrderBy + filterInputTypeName: PlaylistTrackFilterInput + aggregate: + queryRootField: playlistTrackAggregate + subscription: + rootField: playlistTrackAggregate --- kind: ModelPermissions @@ -106,4 +133,5 @@ definition: - role: admin select: filter: null + allowSubscriptions: true diff --git a/fixtures/hasura/sample_mflix/metadata/models/Sessions.hml b/fixtures/hasura/app/metadata/Sessions.hml similarity index 63% rename from fixtures/hasura/sample_mflix/metadata/models/Sessions.hml rename to fixtures/hasura/app/metadata/Sessions.hml index 8f03b1b4..80fca216 100644 --- a/fixtures/hasura/sample_mflix/metadata/models/Sessions.hml +++ b/fixtures/hasura/app/metadata/Sessions.hml @@ -44,24 +44,44 @@ definition: kind: BooleanExpressionType version: v1 definition: - name: SessionsComparisonExp + name: SessionsBoolExp operand: object: type: Sessions comparableFields: - fieldName: id - booleanExpressionType: ObjectIdComparisonExp + booleanExpressionType: ObjectIdBoolExp - fieldName: jwt - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: userId - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp comparableRelationships: [] logicalOperators: enable: true isNull: enable: true graphql: - typeName: SessionsComparisonExp + typeName: SessionsBoolExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: SessionsAggExp + operand: + object: + aggregatedType: Sessions + aggregatableFields: + - fieldName: id + aggregateExpression: ObjectIdAggExp + - fieldName: jwt + aggregateExpression: StringAggExp + - fieldName: userId + aggregateExpression: StringAggExp + count: + enable: true + graphql: + selectTypeName: SessionsAggExp --- kind: Model @@ -72,7 +92,8 @@ definition: source: dataConnectorName: sample_mflix collection: sessions - filterExpressionType: SessionsComparisonExp + filterExpressionType: SessionsBoolExp + aggregateExpression: SessionsAggExp orderableFields: - fieldName: id orderByDirections: @@ -86,11 +107,20 @@ definition: graphql: selectMany: queryRootField: sessions + subscription: + rootField: sessions selectUniques: - queryRootField: sessionsById uniqueIdentifier: - id + subscription: + rootField: sessionsById orderByExpressionType: SessionsOrderBy + filterInputTypeName: SessionsFilterInput + aggregate: + queryRootField: sessionsAggregate + subscription: + rootField: sessionsAggregate --- kind: ModelPermissions @@ -101,4 +131,5 @@ definition: - role: admin select: filter: null + allowSubscriptions: true diff --git a/fixtures/hasura/sample_mflix/metadata/models/Theaters.hml b/fixtures/hasura/app/metadata/Theaters.hml similarity index 76% rename from fixtures/hasura/sample_mflix/metadata/models/Theaters.hml rename to fixtures/hasura/app/metadata/Theaters.hml index 2fb849f3..475594c0 100644 --- a/fixtures/hasura/sample_mflix/metadata/models/Theaters.hml +++ b/fixtures/hasura/app/metadata/Theaters.hml @@ -21,33 +21,6 @@ definition: - dataConnectorName: sample_mflix dataConnectorObjectType: theaters_location_address ---- -kind: BooleanExpressionType -version: v1 -definition: - name: TheatersLocationAddressComparisonExp - operand: - object: - type: TheatersLocationAddress - comparableFields: - - fieldName: city - booleanExpressionType: StringComparisonExp - - fieldName: state - booleanExpressionType: StringComparisonExp - - fieldName: street1 - booleanExpressionType: StringComparisonExp - - fieldName: street2 - booleanExpressionType: StringComparisonExp - - fieldName: zipcode - booleanExpressionType: StringComparisonExp - comparableRelationships: [] - logicalOperators: - enable: true - isNull: - enable: true - graphql: - typeName: TheatersLocationAddressComparisonExp - --- kind: TypePermissions version: v1 @@ -70,7 +43,7 @@ definition: name: TheatersLocationGeo fields: - name: coordinates - type: "[Float!]!" + type: "[Double!]!" - name: type type: String! graphql: @@ -92,25 +65,6 @@ definition: - coordinates - type ---- -kind: BooleanExpressionType -version: v1 -definition: - name: TheatersLocationGeoComparisonExp - operand: - object: - type: TheatersLocationGeo - comparableFields: - - fieldName: type - booleanExpressionType: StringComparisonExp - comparableRelationships: [] - logicalOperators: - enable: true - isNull: - enable: true - graphql: - typeName: TheatersLocationGeoComparisonExp - --- kind: ObjectType version: v1 @@ -140,27 +94,6 @@ definition: - address - geo ---- -kind: BooleanExpressionType -version: v1 -definition: - name: TheatersLocationComparisonExp - operand: - object: - type: TheatersLocation - comparableFields: - - fieldName: address - booleanExpressionType: TheatersLocationAddressComparisonExp - - fieldName: geo - booleanExpressionType: TheatersLocationGeoComparisonExp - comparableRelationships: [] - logicalOperators: - enable: true - isNull: - enable: true - graphql: - typeName: TheatersLocationComparisonExp - --- kind: ObjectType version: v1 @@ -190,64 +123,126 @@ definition: column: name: theaterId +--- +kind: TypePermissions +version: v1 +definition: + typeName: Theaters + permissions: + - role: admin + output: + allowedFields: + - id + - location + - theaterId + --- kind: BooleanExpressionType version: v1 definition: - name: TheatersComparisonExp + name: TheatersLocationAddressBoolExp operand: object: - type: Theaters + type: TheatersLocationAddress comparableFields: - - fieldName: id - booleanExpressionType: ObjectIdComparisonExp - - fieldName: location - booleanExpressionType: TheatersLocationComparisonExp - - fieldName: theaterId - booleanExpressionType: IntComparisonExp + - fieldName: city + booleanExpressionType: StringBoolExp + - fieldName: state + booleanExpressionType: StringBoolExp + - fieldName: street1 + booleanExpressionType: StringBoolExp + - fieldName: street2 + booleanExpressionType: StringBoolExp + - fieldName: zipcode + booleanExpressionType: StringBoolExp comparableRelationships: [] logicalOperators: enable: true isNull: enable: true graphql: - typeName: TheatersComparisonExp + typeName: TheatersLocationAddressBoolExp --- -kind: TypePermissions +kind: BooleanExpressionType version: v1 definition: - typeName: Theaters - permissions: - - role: admin - output: - allowedFields: - - id - - location - - theaterId + name: TheatersLocationGeoBoolExp + operand: + object: + type: TheatersLocationGeo + comparableFields: + - fieldName: type + booleanExpressionType: StringBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: TheatersLocationGeoBoolExp --- kind: BooleanExpressionType version: v1 definition: - name: TheatersComparisonExp + name: TheatersLocationBoolExp + operand: + object: + type: TheatersLocation + comparableFields: + - fieldName: address + booleanExpressionType: TheatersLocationAddressBoolExp + - fieldName: geo + booleanExpressionType: TheatersLocationGeoBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: TheatersLocationBoolExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: TheatersBoolExp operand: object: type: Theaters comparableFields: - fieldName: id - booleanExpressionType: ObjectIdComparisonExp + booleanExpressionType: ObjectIdBoolExp - fieldName: location - booleanExpressionType: TheatersLocationComparisonExp + booleanExpressionType: TheatersLocationBoolExp - fieldName: theaterId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp comparableRelationships: [] logicalOperators: enable: true isNull: enable: true graphql: - typeName: TheatersComparisonExp + typeName: TheatersBoolExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: TheatersAggExp + operand: + object: + aggregatedType: Theaters + aggregatableFields: + - fieldName: id + aggregateExpression: ObjectIdAggExp + - fieldName: theaterId + aggregateExpression: IntAggExp + count: + enable: true + graphql: + selectTypeName: TheatersAggExp --- kind: Model @@ -258,7 +253,8 @@ definition: source: dataConnectorName: sample_mflix collection: theaters - filterExpressionType: TheatersComparisonExp + filterExpressionType: TheatersBoolExp + aggregateExpression: TheatersAggExp orderableFields: - fieldName: id orderByDirections: @@ -272,11 +268,20 @@ definition: graphql: selectMany: queryRootField: theaters + subscription: + rootField: theaters selectUniques: - queryRootField: theatersById uniqueIdentifier: - id + subscription: + rootField: theatersById orderByExpressionType: TheatersOrderBy + filterInputTypeName: TheatersFilterInput + aggregate: + queryRootField: theatersAggregate + subscription: + rootField: theatersAggregate --- kind: ModelPermissions @@ -287,4 +292,5 @@ definition: - role: admin select: filter: null + allowSubscriptions: true diff --git a/fixtures/hasura/app/metadata/TitleWordFrequency.hml b/fixtures/hasura/app/metadata/TitleWordFrequency.hml new file mode 100644 index 00000000..6f0379c2 --- /dev/null +++ b/fixtures/hasura/app/metadata/TitleWordFrequency.hml @@ -0,0 +1,122 @@ +--- +kind: ObjectType +version: v1 +definition: + name: TitleWordFrequencyGroup + fields: + - name: id + type: String! + - name: count + type: Int! + graphql: + typeName: TitleWordFrequencyGroup + inputTypeName: TitleWordFrequencyGroupInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: title_word_frequency_group + fieldMapping: + id: + column: + name: _id + count: + column: + name: count + +--- +kind: TypePermissions +version: v1 +definition: + typeName: TitleWordFrequencyGroup + permissions: + - role: admin + output: + allowedFields: + - id + - count + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: TitleWordFrequencyGroupBoolExp + operand: + object: + type: TitleWordFrequencyGroup + comparableFields: + - fieldName: id + booleanExpressionType: StringBoolExp + - fieldName: count + booleanExpressionType: IntBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: TitleWordFrequencyGroupBoolExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: TitleWordFrequencyGroupAggExp + operand: + object: + aggregatedType: TitleWordFrequencyGroup + aggregatableFields: + - fieldName: id + aggregateExpression: StringAggExp + - fieldName: count + aggregateExpression: IntAggExp + count: + enable: true + graphql: + selectTypeName: TitleWordFrequencyGroupAggExp + +--- +kind: Model +version: v1 +definition: + name: TitleWordFrequency + objectType: TitleWordFrequencyGroup + source: + dataConnectorName: sample_mflix + collection: title_word_frequency + filterExpressionType: TitleWordFrequencyGroupBoolExp + aggregateExpression: TitleWordFrequencyGroupAggExp + orderableFields: + - fieldName: id + orderByDirections: + enableAll: true + - fieldName: count + orderByDirections: + enableAll: true + graphql: + selectMany: + queryRootField: titleWordFrequency + subscription: + rootField: titleWordFrequency + selectUniques: + - queryRootField: titleWordFrequencyById + uniqueIdentifier: + - id + subscription: + rootField: titleWordFrequencyById + orderByExpressionType: TitleWordFrequencyOrderBy + filterInputTypeName: TitleWordFrequencyFilterInput + aggregate: + queryRootField: titleWordFrequencyAggregate + subscription: + rootField: titleWordFrequencyAggregate + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: TitleWordFrequency + permissions: + - role: admin + select: + filter: null + allowSubscriptions: true + diff --git a/fixtures/hasura/chinook/metadata/models/Track.hml b/fixtures/hasura/app/metadata/Track.hml similarity index 70% rename from fixtures/hasura/chinook/metadata/models/Track.hml rename to fixtures/hasura/app/metadata/Track.hml index 4755352d..b29ed569 100644 --- a/fixtures/hasura/chinook/metadata/models/Track.hml +++ b/fixtures/hasura/app/metadata/Track.hml @@ -5,15 +5,15 @@ definition: name: Track fields: - name: id - type: ObjectId! + type: ObjectId_1! - name: albumId - type: Int + type: Int! - name: bytes - type: Int + type: Int! - name: composer type: String - name: genreId - type: Int + type: Int! - name: mediaTypeId type: Int! - name: milliseconds @@ -61,7 +61,6 @@ definition: unitPrice: column: name: UnitPrice - description: Object type for collection Track --- kind: TypePermissions @@ -87,67 +86,77 @@ definition: kind: BooleanExpressionType version: v1 definition: - name: TrackComparisonExp + name: TrackBoolExp operand: object: type: Track comparableFields: - fieldName: id - booleanExpressionType: ObjectIdComparisonExp + booleanExpressionType: ObjectIdBoolExp_1 - fieldName: albumId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: bytes - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: composer - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: genreId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: mediaTypeId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: milliseconds - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: name - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: trackId - booleanExpressionType: IntComparisonExp + booleanExpressionType: IntBoolExp - fieldName: unitPrice - booleanExpressionType: DecimalComparisonExp + booleanExpressionType: DecimalBoolExp comparableRelationships: - relationshipName: album - booleanExpressionType: AlbumComparisonExp - relationshipName: genre - booleanExpressionType: GenreComparisonExp - relationshipName: invoiceLines - booleanExpressionType: InvoiceLineComparisonExp - relationshipName: mediaType - booleanExpressionType: MediaTypeComparisonExp - relationshipName: playlistTracks - booleanExpressionType: PlaylistTrackComparisonExp logicalOperators: enable: true isNull: enable: true graphql: - typeName: TrackComparisonExp + typeName: TrackBoolExp --- kind: AggregateExpression version: v1 definition: - name: TrackAggregateExp + name: TrackAggExp operand: object: aggregatedType: Track aggregatableFields: - - fieldName: unitPrice - aggregateExpression: DecimalAggregateExp + - fieldName: id + aggregateExpression: ObjectIdAggExp_1 + - fieldName: albumId + aggregateExpression: IntAggExp - fieldName: bytes - aggregateExpression: IntAggregateExp + aggregateExpression: IntAggExp + - fieldName: composer + aggregateExpression: StringAggExp + - fieldName: genreId + aggregateExpression: IntAggExp + - fieldName: mediaTypeId + aggregateExpression: IntAggExp - fieldName: milliseconds - aggregateExpression: IntAggregateExp - count: { enable: true } + aggregateExpression: IntAggExp + - fieldName: name + aggregateExpression: StringAggExp + - fieldName: trackId + aggregateExpression: IntAggExp + - fieldName: unitPrice + aggregateExpression: DecimalAggExp + count: + enable: true graphql: - selectTypeName: TrackAggregateExp + selectTypeName: TrackAggExp --- kind: Model @@ -158,8 +167,8 @@ definition: source: dataConnectorName: chinook collection: Track - aggregateExpression: TrackAggregateExp - filterExpressionType: TrackComparisonExp + filterExpressionType: TrackBoolExp + aggregateExpression: TrackAggExp orderableFields: - fieldName: id orderByDirections: @@ -192,17 +201,22 @@ definition: orderByDirections: enableAll: true graphql: - aggregate: - queryRootField: - trackAggregate - filterInputTypeName: TrackFilterInput selectMany: queryRootField: track + subscription: + rootField: track selectUniques: - queryRootField: trackById uniqueIdentifier: - id + subscription: + rootField: trackById orderByExpressionType: TrackOrderBy + filterInputTypeName: TrackFilterInput + aggregate: + queryRootField: trackAggregate + subscription: + rootField: trackAggregate --- kind: ModelPermissions @@ -213,4 +227,5 @@ definition: - role: admin select: filter: null + allowSubscriptions: true diff --git a/fixtures/hasura/chinook/metadata/commands/UpdateTrackPrices.hml b/fixtures/hasura/app/metadata/UpdateTrackPrices.hml similarity index 87% rename from fixtures/hasura/chinook/metadata/commands/UpdateTrackPrices.hml rename to fixtures/hasura/app/metadata/UpdateTrackPrices.hml index 6e8f985a..51669ee5 100644 --- a/fixtures/hasura/chinook/metadata/commands/UpdateTrackPrices.hml +++ b/fixtures/hasura/app/metadata/UpdateTrackPrices.hml @@ -8,13 +8,13 @@ definition: - name: newPrice type: Decimal! - name: where - type: TrackComparisonExp! + type: TrackBoolExp! source: dataConnectorName: chinook dataConnectorCommand: procedure: updateTrackPrices graphql: - rootFieldName: chinook_updateTrackPrices + rootFieldName: updateTrackPrices rootFieldKind: Mutation description: Update unit price of every track that matches predicate diff --git a/fixtures/hasura/sample_mflix/metadata/models/Users.hml b/fixtures/hasura/app/metadata/Users.hml similarity index 64% rename from fixtures/hasura/sample_mflix/metadata/models/Users.hml rename to fixtures/hasura/app/metadata/Users.hml index 322daedb..e74616d8 100644 --- a/fixtures/hasura/sample_mflix/metadata/models/Users.hml +++ b/fixtures/hasura/app/metadata/Users.hml @@ -62,28 +62,51 @@ definition: kind: BooleanExpressionType version: v1 definition: - name: UsersComparisonExp + name: UsersBoolExp operand: object: type: Users comparableFields: - fieldName: id - booleanExpressionType: ObjectIdComparisonExp + booleanExpressionType: ObjectIdBoolExp - fieldName: email - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: name - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp - fieldName: password - booleanExpressionType: StringComparisonExp + booleanExpressionType: StringBoolExp + - fieldName: preferences + booleanExpressionType: UsersPreferencesBoolExp comparableRelationships: - relationshipName: comments - booleanExpressionType: CommentsComparisonExp logicalOperators: enable: true isNull: enable: true graphql: - typeName: UsersComparisonExp + typeName: UsersBoolExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: UsersAggExp + operand: + object: + aggregatedType: Users + aggregatableFields: + - fieldName: id + aggregateExpression: ObjectIdAggExp + - fieldName: email + aggregateExpression: StringAggExp + - fieldName: name + aggregateExpression: StringAggExp + - fieldName: password + aggregateExpression: StringAggExp + count: + enable: true + graphql: + selectTypeName: UsersAggExp --- kind: Model @@ -94,7 +117,8 @@ definition: source: dataConnectorName: sample_mflix collection: users - filterExpressionType: UsersComparisonExp + filterExpressionType: UsersBoolExp + aggregateExpression: UsersAggExp orderableFields: - fieldName: id orderByDirections: @@ -114,11 +138,20 @@ definition: graphql: selectMany: queryRootField: users + subscription: + rootField: users selectUniques: - queryRootField: usersById uniqueIdentifier: - id + subscription: + rootField: usersById orderByExpressionType: UsersOrderBy + filterInputTypeName: UsersFilterInput + aggregate: + queryRootField: usersAggregate + subscription: + rootField: usersAggregate --- kind: ModelPermissions @@ -129,6 +162,7 @@ definition: - role: admin select: filter: null + allowSubscriptions: true - role: user select: filter: @@ -145,8 +179,8 @@ definition: name: UsersPreferences fields: [] graphql: - typeName: SampleMflix_UsersPreferences - inputTypeName: SampleMflix_UsersPreferencesInput + typeName: UsersPreferences + inputTypeName: UsersPreferencesInput dataConnectorTypeMapping: - dataConnectorName: sample_mflix dataConnectorObjectType: users_preferences @@ -161,3 +195,20 @@ definition: output: allowedFields: [] +--- +kind: BooleanExpressionType +version: v1 +definition: + name: UsersPreferencesBoolExp + operand: + object: + type: UsersPreferences + comparableFields: [] + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: UsersPreferencesBoolExp + diff --git a/fixtures/hasura/app/metadata/WeirdFieldNames.hml b/fixtures/hasura/app/metadata/WeirdFieldNames.hml new file mode 100644 index 00000000..03d33ac1 --- /dev/null +++ b/fixtures/hasura/app/metadata/WeirdFieldNames.hml @@ -0,0 +1,302 @@ +--- +kind: ObjectType +version: v1 +definition: + name: WeirdFieldNamesInvalidArray + fields: + - name: invalidElement + type: Int! + graphql: + typeName: WeirdFieldNamesInvalidArray + inputTypeName: WeirdFieldNamesInvalidArrayInput + dataConnectorTypeMapping: + - dataConnectorName: test_cases + dataConnectorObjectType: weird_field_names_$invalid.array + fieldMapping: + invalidElement: + column: + name: $invalid.element + +--- +kind: TypePermissions +version: v1 +definition: + typeName: WeirdFieldNamesInvalidArray + permissions: + - role: admin + output: + allowedFields: + - invalidElement + +--- +kind: ObjectType +version: v1 +definition: + name: WeirdFieldNamesInvalidObjectName + fields: + - name: validName + type: Int! + graphql: + typeName: WeirdFieldNamesInvalidObjectName + inputTypeName: WeirdFieldNamesInvalidObjectNameInput + dataConnectorTypeMapping: + - dataConnectorName: test_cases + dataConnectorObjectType: weird_field_names_$invalid.object.name + fieldMapping: + validName: + column: + name: valid_name + +--- +kind: TypePermissions +version: v1 +definition: + typeName: WeirdFieldNamesInvalidObjectName + permissions: + - role: admin + output: + allowedFields: + - validName + +--- +kind: ObjectType +version: v1 +definition: + name: WeirdFieldNamesValidObjectName + fields: + - name: invalidNestedName + type: Int! + graphql: + typeName: WeirdFieldNamesValidObjectName + inputTypeName: WeirdFieldNamesValidObjectNameInput + dataConnectorTypeMapping: + - dataConnectorName: test_cases + dataConnectorObjectType: weird_field_names_valid_object_name + fieldMapping: + invalidNestedName: + column: + name: $invalid.nested.name + +--- +kind: TypePermissions +version: v1 +definition: + typeName: WeirdFieldNamesValidObjectName + permissions: + - role: admin + output: + allowedFields: + - invalidNestedName + +--- +kind: ObjectType +version: v1 +definition: + name: WeirdFieldNames + fields: + - name: invalidArray + type: "[WeirdFieldNamesInvalidArray!]!" + - name: invalidName + type: Int! + - name: invalidObjectName + type: WeirdFieldNamesInvalidObjectName! + - name: id + type: ObjectId_2! + - name: validObjectName + type: WeirdFieldNamesValidObjectName! + graphql: + typeName: WeirdFieldNames + inputTypeName: WeirdFieldNamesInput + dataConnectorTypeMapping: + - dataConnectorName: test_cases + dataConnectorObjectType: weird_field_names + fieldMapping: + invalidArray: + column: + name: $invalid.array + invalidName: + column: + name: $invalid.name + invalidObjectName: + column: + name: $invalid.object.name + id: + column: + name: _id + validObjectName: + column: + name: valid_object_name + +--- +kind: TypePermissions +version: v1 +definition: + typeName: WeirdFieldNames + permissions: + - role: admin + output: + allowedFields: + - invalidArray + - invalidName + - invalidObjectName + - id + - validObjectName + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: WeirdFieldNamesInvalidArrayBoolExp + operand: + object: + type: WeirdFieldNamesInvalidArray + comparableFields: + - fieldName: invalidElement + booleanExpressionType: IntBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: WeirdFieldNamesInvalidArrayBoolExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: WeirdFieldNamesInvalidObjectNameBoolExp + operand: + object: + type: WeirdFieldNamesInvalidObjectName + comparableFields: + - fieldName: validName + booleanExpressionType: IntBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: WeirdFieldNamesInvalidObjectNameBoolExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: WeirdFieldNamesValidObjectNameBoolExp + operand: + object: + type: WeirdFieldNamesValidObjectName + comparableFields: + - fieldName: invalidNestedName + booleanExpressionType: IntBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: WeirdFieldNamesValidObjectNameBoolExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: WeirdFieldNamesBoolExp + operand: + object: + type: WeirdFieldNames + comparableFields: + - fieldName: invalidArray + booleanExpressionType: WeirdFieldNamesInvalidArrayBoolExp + - fieldName: invalidName + booleanExpressionType: IntBoolExp + - fieldName: invalidObjectName + booleanExpressionType: WeirdFieldNamesInvalidObjectNameBoolExp + - fieldName: id + booleanExpressionType: ObjectIdBoolExp_2 + - fieldName: validObjectName + booleanExpressionType: WeirdFieldNamesValidObjectNameBoolExp + comparableRelationships: [] + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: WeirdFieldNamesBoolExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: WeirdFieldNamesAggExp + operand: + object: + aggregatedType: WeirdFieldNames + aggregatableFields: + - fieldName: invalidName + aggregateExpression: IntAggExp + - fieldName: id + aggregateExpression: ObjectIdAggExp_2 + count: + enable: true + graphql: + selectTypeName: WeirdFieldNamesAggExp + +--- +kind: Model +version: v1 +definition: + name: WeirdFieldNames + objectType: WeirdFieldNames + source: + dataConnectorName: test_cases + collection: weird_field_names + filterExpressionType: WeirdFieldNamesBoolExp + aggregateExpression: WeirdFieldNamesAggExp + orderableFields: + - fieldName: invalidArray + orderByDirections: + enableAll: true + - fieldName: invalidName + orderByDirections: + enableAll: true + - fieldName: invalidObjectName + orderByDirections: + enableAll: true + - fieldName: id + orderByDirections: + enableAll: true + - fieldName: validObjectName + orderByDirections: + enableAll: true + graphql: + selectMany: + queryRootField: weirdFieldNames + subscription: + rootField: weirdFieldNames + selectUniques: + - queryRootField: weirdFieldNamesById + uniqueIdentifier: + - id + subscription: + rootField: weirdFieldNamesById + orderByExpressionType: WeirdFieldNamesOrderBy + filterInputTypeName: WeirdFieldNamesFilterInput + aggregate: + queryRootField: weirdFieldNamesAggregate + subscription: + rootField: weirdFieldNamesAggregate + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: WeirdFieldNames + permissions: + - role: admin + select: + filter: null + allowSubscriptions: true + diff --git a/fixtures/hasura/app/metadata/chinook-types.hml b/fixtures/hasura/app/metadata/chinook-types.hml new file mode 100644 index 00000000..b2a2b1ad --- /dev/null +++ b/fixtures/hasura/app/metadata/chinook-types.hml @@ -0,0 +1,238 @@ +--- +kind: ScalarType +version: v1 +definition: + name: ObjectId_1 + graphql: + typeName: ObjectId1 + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: ObjectIdBoolExp_1 + operand: + scalar: + type: ObjectId_1 + comparisonOperators: + - name: _eq + argumentType: ObjectId_1! + - name: _in + argumentType: "[ObjectId_1!]!" + - name: _neq + argumentType: ObjectId_1! + - name: _nin + argumentType: "[ObjectId_1!]!" + dataConnectorOperatorMapping: + - dataConnectorName: chinook + dataConnectorScalarType: ObjectId + operatorMapping: {} + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: ObjectIdBoolExp1 + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: chinook + dataConnectorScalarType: ObjectId + representation: ObjectId_1 + graphql: + comparisonExpressionTypeName: ObjectId1ComparisonExp + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: chinook + dataConnectorScalarType: Int + representation: Int + graphql: + comparisonExpressionTypeName: IntComparisonExp_1 + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: chinook + dataConnectorScalarType: String + representation: String + graphql: + comparisonExpressionTypeName: StringComparisonExp_1 + +--- +kind: AggregateExpression +version: v1 +definition: + name: ObjectIdAggExp_1 + operand: + scalar: + aggregatedType: ObjectId_1 + aggregationFunctions: + - name: count + returnType: Int! + dataConnectorAggregationFunctionMapping: + - dataConnectorName: chinook + dataConnectorScalarType: ObjectId + functionMapping: + count: + name: count + count: + enable: true + countDistinct: + enable: true + graphql: + selectTypeName: ObjectIdAggExp1 + +--- +kind: ScalarType +version: v1 +definition: + name: Decimal + graphql: + typeName: Decimal + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: DecimalBoolExp + operand: + scalar: + type: Decimal + comparisonOperators: + - name: _eq + argumentType: Decimal! + - name: _gt + argumentType: Decimal! + - name: _gte + argumentType: Decimal! + - name: _in + argumentType: "[Decimal!]!" + - name: _lt + argumentType: Decimal! + - name: _lte + argumentType: Decimal! + - name: _neq + argumentType: Decimal! + - name: _nin + argumentType: "[Decimal!]!" + dataConnectorOperatorMapping: + - dataConnectorName: chinook + dataConnectorScalarType: Decimal + operatorMapping: {} + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: DecimalBoolExp + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: chinook + dataConnectorScalarType: Decimal + representation: Decimal + graphql: + comparisonExpressionTypeName: DecimalComparisonExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: DecimalAggExp + operand: + scalar: + aggregatedType: Decimal + aggregationFunctions: + - name: avg + returnType: Decimal! + - name: count + returnType: Int! + - name: max + returnType: Decimal! + - name: min + returnType: Decimal! + - name: sum + returnType: Decimal! + dataConnectorAggregationFunctionMapping: + - dataConnectorName: chinook + dataConnectorScalarType: Decimal + functionMapping: + avg: + name: avg + count: + name: count + max: + name: max + min: + name: min + sum: + name: sum + count: + enable: true + countDistinct: + enable: true + graphql: + selectTypeName: DecimalAggExp + +--- +kind: ScalarType +version: v1 +definition: + name: Double_1 + graphql: + typeName: Double1 + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: DoubleBoolExp_1 + operand: + scalar: + type: Double_1 + comparisonOperators: + - name: _eq + argumentType: Double_1! + - name: _gt + argumentType: Double_1! + - name: _gte + argumentType: Double_1! + - name: _in + argumentType: "[Double_1!]!" + - name: _lt + argumentType: Double_1! + - name: _lte + argumentType: Double_1! + - name: _neq + argumentType: Double_1! + - name: _nin + argumentType: "[Double_1!]!" + dataConnectorOperatorMapping: + - dataConnectorName: chinook + dataConnectorScalarType: Double + operatorMapping: {} + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: DoubleBoolExp1 + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: chinook + dataConnectorScalarType: Double + representation: Double_1 + graphql: + comparisonExpressionTypeName: Double1ComparisonExp + diff --git a/fixtures/hasura/chinook/metadata/chinook.hml b/fixtures/hasura/app/metadata/chinook.hml similarity index 88% rename from fixtures/hasura/chinook/metadata/chinook.hml rename to fixtures/hasura/app/metadata/chinook.hml index d66b9dbc..ce33d33f 100644 --- a/fixtures/hasura/chinook/metadata/chinook.hml +++ b/fixtures/hasura/app/metadata/chinook.hml @@ -5,9 +5,9 @@ definition: url: readWriteUrls: read: - valueFromEnv: CHINOOK_CONNECTOR_URL + valueFromEnv: APP_CHINOOK_READ_URL write: - valueFromEnv: CHINOOK_CONNECTOR_URL + valueFromEnv: APP_CHINOOK_WRITE_URL schema: version: v0.1 schema: @@ -729,7 +729,6 @@ definition: name: Undefined object_types: Album: - description: Object type for collection Album fields: _id: type: @@ -764,7 +763,6 @@ definition: type: named name: Track Artist: - description: Object type for collection Artist fields: _id: type: @@ -776,10 +774,8 @@ definition: name: Int Name: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String ArtistWithAlbumsAndTracks: fields: _id: @@ -797,7 +793,6 @@ definition: type: named name: String Customer: - description: Object type for collection Customer fields: _id: type: @@ -805,16 +800,12 @@ definition: name: ObjectId Address: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String City: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String Company: type: type: nullable @@ -823,10 +814,8 @@ definition: name: String Country: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String CustomerId: type: type: named @@ -869,12 +858,9 @@ definition: name: String SupportRepId: type: - type: nullable - underlying_type: - type: named - name: Int + type: named + name: Int Employee: - description: Object type for collection Employee fields: _id: type: @@ -882,70 +868,52 @@ definition: name: ObjectId Address: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String BirthDate: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String City: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String Country: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String Email: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String EmployeeId: type: type: named name: Int Fax: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String FirstName: type: type: named name: String HireDate: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String LastName: type: type: named name: String Phone: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String PostalCode: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String ReportsTo: type: type: nullable @@ -954,18 +922,13 @@ definition: name: Int State: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String Title: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String Genre: - description: Object type for collection Genre fields: _id: type: @@ -977,10 +940,8 @@ definition: name: Int Name: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String InsertArtist: fields: "n": @@ -992,7 +953,6 @@ definition: type: named name: Double Invoice: - description: Object type for collection Invoice fields: _id: type: @@ -1000,22 +960,16 @@ definition: name: ObjectId BillingAddress: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String BillingCity: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String BillingCountry: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String BillingPostalCode: type: type: nullable @@ -1045,7 +999,6 @@ definition: type: named name: Decimal InvoiceLine: - description: Object type for collection InvoiceLine fields: _id: type: @@ -1072,7 +1025,6 @@ definition: type: named name: Decimal MediaType: - description: Object type for collection MediaType fields: _id: type: @@ -1084,12 +1036,9 @@ definition: name: Int Name: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String Playlist: - description: Object type for collection Playlist fields: _id: type: @@ -1097,16 +1046,13 @@ definition: name: ObjectId Name: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String PlaylistId: type: type: named name: Int PlaylistTrack: - description: Object type for collection PlaylistTrack fields: _id: type: @@ -1121,7 +1067,6 @@ definition: type: named name: Int Track: - description: Object type for collection Track fields: _id: type: @@ -1129,16 +1074,12 @@ definition: name: ObjectId AlbumId: type: - type: nullable - underlying_type: - type: named - name: Int + type: named + name: Int Bytes: type: - type: nullable - underlying_type: - type: named - name: Int + type: named + name: Int Composer: type: type: nullable @@ -1147,10 +1088,8 @@ definition: name: String GenreId: type: - type: nullable - underlying_type: - type: named - name: Int + type: named + name: Int MediaTypeId: type: type: named @@ -1309,6 +1248,8 @@ definition: nested_fields: filter_by: {} order_by: {} + exists: + nested_collections: {} mutation: {} relationships: relation_comparisons: {} diff --git a/fixtures/hasura/common/metadata/relationships/album_movie.hml b/fixtures/hasura/app/metadata/relationships/album_movie.hml similarity index 100% rename from fixtures/hasura/common/metadata/relationships/album_movie.hml rename to fixtures/hasura/app/metadata/relationships/album_movie.hml diff --git a/fixtures/hasura/chinook/metadata/relationships/album_tracks.hml b/fixtures/hasura/app/metadata/relationships/album_tracks.hml similarity index 100% rename from fixtures/hasura/chinook/metadata/relationships/album_tracks.hml rename to fixtures/hasura/app/metadata/relationships/album_tracks.hml diff --git a/fixtures/hasura/chinook/metadata/relationships/artist_albums.hml b/fixtures/hasura/app/metadata/relationships/artist_albums.hml similarity index 100% rename from fixtures/hasura/chinook/metadata/relationships/artist_albums.hml rename to fixtures/hasura/app/metadata/relationships/artist_albums.hml diff --git a/fixtures/hasura/chinook/metadata/relationships/customer_invoices.hml b/fixtures/hasura/app/metadata/relationships/customer_invoices.hml similarity index 100% rename from fixtures/hasura/chinook/metadata/relationships/customer_invoices.hml rename to fixtures/hasura/app/metadata/relationships/customer_invoices.hml diff --git a/fixtures/hasura/chinook/metadata/relationships/employee_customers.hml b/fixtures/hasura/app/metadata/relationships/employee_customers.hml similarity index 100% rename from fixtures/hasura/chinook/metadata/relationships/employee_customers.hml rename to fixtures/hasura/app/metadata/relationships/employee_customers.hml diff --git a/fixtures/hasura/chinook/metadata/relationships/employee_employees.hml b/fixtures/hasura/app/metadata/relationships/employee_employees.hml similarity index 100% rename from fixtures/hasura/chinook/metadata/relationships/employee_employees.hml rename to fixtures/hasura/app/metadata/relationships/employee_employees.hml diff --git a/fixtures/hasura/chinook/metadata/relationships/genre_tracks.hml b/fixtures/hasura/app/metadata/relationships/genre_tracks.hml similarity index 100% rename from fixtures/hasura/chinook/metadata/relationships/genre_tracks.hml rename to fixtures/hasura/app/metadata/relationships/genre_tracks.hml diff --git a/fixtures/hasura/chinook/metadata/relationships/invoice_lines.hml b/fixtures/hasura/app/metadata/relationships/invoice_lines.hml similarity index 100% rename from fixtures/hasura/chinook/metadata/relationships/invoice_lines.hml rename to fixtures/hasura/app/metadata/relationships/invoice_lines.hml diff --git a/fixtures/hasura/chinook/metadata/relationships/media_type_tracks.hml b/fixtures/hasura/app/metadata/relationships/media_type_tracks.hml similarity index 100% rename from fixtures/hasura/chinook/metadata/relationships/media_type_tracks.hml rename to fixtures/hasura/app/metadata/relationships/media_type_tracks.hml diff --git a/fixtures/hasura/sample_mflix/metadata/relationships/movie_comments.hml b/fixtures/hasura/app/metadata/relationships/movie_comments.hml similarity index 100% rename from fixtures/hasura/sample_mflix/metadata/relationships/movie_comments.hml rename to fixtures/hasura/app/metadata/relationships/movie_comments.hml diff --git a/fixtures/hasura/chinook/metadata/relationships/playlist_tracks.hml b/fixtures/hasura/app/metadata/relationships/playlist_tracks.hml similarity index 100% rename from fixtures/hasura/chinook/metadata/relationships/playlist_tracks.hml rename to fixtures/hasura/app/metadata/relationships/playlist_tracks.hml diff --git a/fixtures/hasura/chinook/metadata/relationships/track_invoice_lines.hml b/fixtures/hasura/app/metadata/relationships/track_invoice_lines.hml similarity index 100% rename from fixtures/hasura/chinook/metadata/relationships/track_invoice_lines.hml rename to fixtures/hasura/app/metadata/relationships/track_invoice_lines.hml diff --git a/fixtures/hasura/sample_mflix/metadata/relationships/user_comments.hml b/fixtures/hasura/app/metadata/relationships/user_comments.hml similarity index 100% rename from fixtures/hasura/sample_mflix/metadata/relationships/user_comments.hml rename to fixtures/hasura/app/metadata/relationships/user_comments.hml diff --git a/fixtures/hasura/app/metadata/sample_mflix-types.hml b/fixtures/hasura/app/metadata/sample_mflix-types.hml new file mode 100644 index 00000000..b3b63d7b --- /dev/null +++ b/fixtures/hasura/app/metadata/sample_mflix-types.hml @@ -0,0 +1,532 @@ +--- +kind: ScalarType +version: v1 +definition: + name: ObjectId + graphql: + typeName: ObjectId + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: ObjectIdBoolExp + operand: + scalar: + type: ObjectId + comparisonOperators: + - name: _eq + argumentType: ObjectId! + - name: _in + argumentType: "[ObjectId!]!" + - name: _neq + argumentType: ObjectId! + - name: _nin + argumentType: "[ObjectId!]!" + dataConnectorOperatorMapping: + - dataConnectorName: sample_mflix + dataConnectorScalarType: ObjectId + operatorMapping: {} + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: ObjectIdBoolExp + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: sample_mflix + dataConnectorScalarType: ObjectId + representation: ObjectId + graphql: + comparisonExpressionTypeName: ObjectIdComparisonExp + +--- +kind: ScalarType +version: v1 +definition: + name: Date + graphql: + typeName: Date + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: DateBoolExp + operand: + scalar: + type: Date + comparisonOperators: + - name: _eq + argumentType: Date! + - name: _gt + argumentType: Date! + - name: _gte + argumentType: Date! + - name: _in + argumentType: "[Date!]!" + - name: _lt + argumentType: Date! + - name: _lte + argumentType: Date! + - name: _neq + argumentType: Date! + - name: _nin + argumentType: "[Date!]!" + dataConnectorOperatorMapping: + - dataConnectorName: sample_mflix + dataConnectorScalarType: Date + operatorMapping: {} + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: DateBoolExp + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: sample_mflix + dataConnectorScalarType: Date + representation: Date + graphql: + comparisonExpressionTypeName: DateComparisonExp + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: sample_mflix + dataConnectorScalarType: String + representation: String + graphql: + comparisonExpressionTypeName: StringComparisonExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: StringBoolExp + operand: + scalar: + type: String + comparisonOperators: + - name: _eq + argumentType: String! + - name: _gt + argumentType: String! + - name: _gte + argumentType: String! + - name: _in + argumentType: "[String!]!" + - name: _iregex + argumentType: String! + - name: _lt + argumentType: String! + - name: _lte + argumentType: String! + - name: _neq + argumentType: String! + - name: _nin + argumentType: "[String!]!" + - name: _regex + argumentType: String! + dataConnectorOperatorMapping: + - dataConnectorName: sample_mflix + dataConnectorScalarType: String + operatorMapping: {} + - dataConnectorName: chinook + dataConnectorScalarType: String + operatorMapping: {} + - dataConnectorName: test_cases + dataConnectorScalarType: String + operatorMapping: {} + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: StringBoolExp + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: sample_mflix + dataConnectorScalarType: Int + representation: Int + graphql: + comparisonExpressionTypeName: IntComparisonExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: ObjectIdAggExp + operand: + scalar: + aggregatedType: ObjectId + aggregationFunctions: + - name: count + returnType: Int! + dataConnectorAggregationFunctionMapping: + - dataConnectorName: sample_mflix + dataConnectorScalarType: ObjectId + functionMapping: + count: + name: count + count: + enable: true + countDistinct: + enable: true + graphql: + selectTypeName: ObjectIdAggExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: DateAggExp + operand: + scalar: + aggregatedType: Date + aggregationFunctions: + - name: count + returnType: Int! + - name: max + returnType: Date! + - name: min + returnType: Date! + dataConnectorAggregationFunctionMapping: + - dataConnectorName: sample_mflix + dataConnectorScalarType: Date + functionMapping: + count: + name: count + max: + name: max + min: + name: min + count: + enable: true + countDistinct: + enable: true + graphql: + selectTypeName: DateAggExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: StringAggExp + operand: + scalar: + aggregatedType: String + aggregationFunctions: + - name: count + returnType: Int! + - name: max + returnType: String! + - name: min + returnType: String! + dataConnectorAggregationFunctionMapping: + - dataConnectorName: sample_mflix + dataConnectorScalarType: String + functionMapping: + count: + name: count + max: + name: max + min: + name: min + - dataConnectorName: chinook + dataConnectorScalarType: String + functionMapping: + count: + name: count + max: + name: max + min: + name: min + - dataConnectorName: test_cases + dataConnectorScalarType: String + functionMapping: + count: + name: count + max: + name: max + min: + name: min + count: + enable: true + countDistinct: + enable: true + graphql: + selectTypeName: StringAggExp + +--- +kind: ScalarType +version: v1 +definition: + name: Double + graphql: + typeName: Double + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: DoubleBoolExp + operand: + scalar: + type: Double + comparisonOperators: + - name: _eq + argumentType: Double! + - name: _gt + argumentType: Double! + - name: _gte + argumentType: Double! + - name: _in + argumentType: "[Double!]!" + - name: _lt + argumentType: Double! + - name: _lte + argumentType: Double! + - name: _neq + argumentType: Double! + - name: _nin + argumentType: "[Double!]!" + dataConnectorOperatorMapping: + - dataConnectorName: sample_mflix + dataConnectorScalarType: Double + operatorMapping: {} + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: DoubleBoolExp + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: sample_mflix + dataConnectorScalarType: Double + representation: Double + graphql: + comparisonExpressionTypeName: DoubleComparisonExp + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: IntBoolExp + operand: + scalar: + type: Int + comparisonOperators: + - name: _eq + argumentType: Int! + - name: _gt + argumentType: Int! + - name: _gte + argumentType: Int! + - name: _in + argumentType: "[Int!]!" + - name: _lt + argumentType: Int! + - name: _lte + argumentType: Int! + - name: _neq + argumentType: Int! + - name: _nin + argumentType: "[Int!]!" + dataConnectorOperatorMapping: + - dataConnectorName: sample_mflix + dataConnectorScalarType: Int + operatorMapping: {} + - dataConnectorName: chinook + dataConnectorScalarType: Int + operatorMapping: {} + - dataConnectorName: test_cases + dataConnectorScalarType: Int + operatorMapping: {} + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: IntBoolExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: IntAggExp + operand: + scalar: + aggregatedType: Int + aggregationFunctions: + - name: avg + returnType: Int! + - name: count + returnType: Int! + - name: max + returnType: Int! + - name: min + returnType: Int! + - name: sum + returnType: Int! + dataConnectorAggregationFunctionMapping: + - dataConnectorName: sample_mflix + dataConnectorScalarType: Int + functionMapping: + avg: + name: avg + count: + name: count + max: + name: max + min: + name: min + sum: + name: sum + - dataConnectorName: chinook + dataConnectorScalarType: Int + functionMapping: + avg: + name: avg + count: + name: count + max: + name: max + min: + name: min + sum: + name: sum + - dataConnectorName: test_cases + dataConnectorScalarType: Int + functionMapping: + avg: + name: avg + count: + name: count + max: + name: max + min: + name: min + sum: + name: sum + count: + enable: true + countDistinct: + enable: true + graphql: + selectTypeName: IntAggExp + +--- +kind: ScalarType +version: v1 +definition: + name: ExtendedJson + graphql: + typeName: ExtendedJson + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: ExtendedJsonBoolExp + operand: + scalar: + type: ExtendedJson + comparisonOperators: + - name: _eq + argumentType: ExtendedJson! + - name: _gt + argumentType: ExtendedJson! + - name: _gte + argumentType: ExtendedJson! + - name: _in + argumentType: ExtendedJson! + - name: _iregex + argumentType: String! + - name: _lt + argumentType: ExtendedJson! + - name: _lte + argumentType: ExtendedJson! + - name: _neq + argumentType: ExtendedJson! + - name: _nin + argumentType: ExtendedJson! + - name: _regex + argumentType: String! + dataConnectorOperatorMapping: + - dataConnectorName: sample_mflix + dataConnectorScalarType: ExtendedJSON + operatorMapping: {} + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: ExtendedJsonBoolExp + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: sample_mflix + dataConnectorScalarType: ExtendedJSON + representation: ExtendedJson + graphql: + comparisonExpressionTypeName: ExtendedJsonComparisonExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: ExtendedJsonAggExp + operand: + scalar: + aggregatedType: ExtendedJson + aggregationFunctions: + - name: avg + returnType: ExtendedJson! + - name: count + returnType: Int! + - name: max + returnType: ExtendedJson! + - name: min + returnType: ExtendedJson! + - name: sum + returnType: ExtendedJson! + dataConnectorAggregationFunctionMapping: + - dataConnectorName: sample_mflix + dataConnectorScalarType: ExtendedJSON + functionMapping: + avg: + name: avg + count: + name: count + max: + name: max + min: + name: min + sum: + name: sum + count: + enable: true + countDistinct: + enable: true + graphql: + selectTypeName: ExtendedJsonAggExp + diff --git a/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml b/fixtures/hasura/app/metadata/sample_mflix.hml similarity index 87% rename from fixtures/hasura/sample_mflix/metadata/sample_mflix.hml rename to fixtures/hasura/app/metadata/sample_mflix.hml index 71bb110d..50e46e73 100644 --- a/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml +++ b/fixtures/hasura/app/metadata/sample_mflix.hml @@ -5,9 +5,9 @@ definition: url: readWriteUrls: read: - valueFromEnv: SAMPLE_MFLIX_CONNECTOR_URL + valueFromEnv: APP_SAMPLE_MFLIX_READ_URL write: - valueFromEnv: SAMPLE_MFLIX_CONNECTOR_URL + valueFromEnv: APP_SAMPLE_MFLIX_WRITE_URL schema: version: v0.1 schema: @@ -746,16 +746,6 @@ definition: type: type: named name: String - TitleWordFrequency: - fields: - _id: - type: - type: named - name: String - count: - type: - type: named - name: Int comments: fields: _id: @@ -782,6 +772,60 @@ definition: type: type: named name: String + eq_title_project: + fields: + _id: + type: + type: named + name: ObjectId + bar: + type: + type: named + name: eq_title_project_bar + foo: + type: + type: named + name: eq_title_project_foo + title: + type: + type: named + name: String + tomatoes: + type: + type: nullable + underlying_type: + type: named + name: movies_tomatoes + what: + type: + type: named + name: eq_title_project_what + eq_title_project_bar: + fields: + foo: + type: + type: named + name: movies_imdb + eq_title_project_foo: + fields: + bar: + type: + type: nullable + underlying_type: + type: named + name: movies_tomatoes_critic + eq_title_project_what: + fields: + the: + type: + type: named + name: eq_title_project_what_the + eq_title_project_what_the: + fields: + heck: + type: + type: named + name: String movies: fields: _id: @@ -808,10 +852,12 @@ definition: name: String directors: type: - type: array - element_type: - type: named - name: String + type: nullable + underlying_type: + type: array + element_type: + type: named + name: String fullplot: type: type: nullable @@ -820,10 +866,12 @@ definition: name: String genres: type: - type: array - element_type: - type: named - name: String + type: nullable + underlying_type: + type: array + element_type: + type: named + name: String imdb: type: type: named @@ -1002,12 +1050,16 @@ definition: name: Int numReviews: type: - type: named - name: Int + type: nullable + underlying_type: + type: named + name: Int rating: type: - type: named - name: Double + type: nullable + underlying_type: + type: named + name: Double movies_tomatoes_viewer: fields: meter: @@ -1021,9 +1073,65 @@ definition: type: named name: Int rating: + type: + type: nullable + underlying_type: + type: named + name: Double + native_query_project: + fields: + _id: type: type: named - name: Double + name: ObjectId + bar: + type: + type: named + name: native_query_project_bar + foo: + type: + type: named + name: native_query_project_foo + title: + type: + type: named + name: String + tomatoes: + type: + type: nullable + underlying_type: + type: named + name: movies_tomatoes + what: + type: + type: named + name: native_query_project_what + native_query_project_bar: + fields: + foo: + type: + type: named + name: movies_imdb + native_query_project_foo: + fields: + bar: + type: + type: nullable + underlying_type: + type: named + name: movies_tomatoes_critic + native_query_project_what: + fields: + the: + type: + type: named + name: native_query_project_what_the + native_query_project_what_the: + fields: + heck: + type: + type: named + name: String sessions: fields: _id: @@ -1098,6 +1206,16 @@ definition: type: type: named name: String + title_word_frequency_group: + fields: + _id: + type: + type: named + name: String + count: + type: + type: named + name: Int users: fields: _id: @@ -1133,6 +1251,22 @@ definition: unique_columns: - _id foreign_keys: {} + - name: eq_title + arguments: + title: + type: + type: named + name: String + year: + type: + type: named + name: Int + type: eq_title_project + uniqueness_constraints: + eq_title_id: + unique_columns: + - _id + foreign_keys: {} - name: extended_json_test_data description: various values that all have the ExtendedJSON type arguments: {} @@ -1147,6 +1281,18 @@ definition: unique_columns: - _id foreign_keys: {} + - name: native_query + arguments: + title: + type: + type: named + name: String + type: native_query_project + uniqueness_constraints: + native_query_id: + unique_columns: + - _id + foreign_keys: {} - name: sessions arguments: {} type: sessions @@ -1164,9 +1310,8 @@ definition: - _id foreign_keys: {} - name: title_word_frequency - description: words appearing in movie titles with counts arguments: {} - type: TitleWordFrequency + type: title_word_frequency_group uniqueness_constraints: title_word_frequency_id: unique_columns: @@ -1202,6 +1347,8 @@ definition: nested_fields: filter_by: {} order_by: {} + exists: + nested_collections: {} mutation: {} relationships: relation_comparisons: {} diff --git a/fixtures/hasura/app/metadata/test_cases-types.hml b/fixtures/hasura/app/metadata/test_cases-types.hml new file mode 100644 index 00000000..89cc958e --- /dev/null +++ b/fixtures/hasura/app/metadata/test_cases-types.hml @@ -0,0 +1,90 @@ +--- +kind: ScalarType +version: v1 +definition: + name: ObjectId_2 + graphql: + typeName: ObjectId2 + +--- +kind: BooleanExpressionType +version: v1 +definition: + name: ObjectIdBoolExp_2 + operand: + scalar: + type: ObjectId_2 + comparisonOperators: + - name: _eq + argumentType: ObjectId_2! + - name: _in + argumentType: "[ObjectId_2!]!" + - name: _neq + argumentType: ObjectId_2! + - name: _nin + argumentType: "[ObjectId_2!]!" + dataConnectorOperatorMapping: + - dataConnectorName: test_cases + dataConnectorScalarType: ObjectId + operatorMapping: {} + logicalOperators: + enable: true + isNull: + enable: true + graphql: + typeName: ObjectIdBoolExp2 + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: test_cases + dataConnectorScalarType: ObjectId + representation: ObjectId_2 + graphql: + comparisonExpressionTypeName: ObjectId2ComparisonExp + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: test_cases + dataConnectorScalarType: String + representation: String + graphql: + comparisonExpressionTypeName: StringComparisonExp_2 + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: test_cases + dataConnectorScalarType: Int + representation: Int + graphql: + comparisonExpressionTypeName: IntComparisonExp_2 + +--- +kind: AggregateExpression +version: v1 +definition: + name: ObjectIdAggExp_2 + operand: + scalar: + aggregatedType: ObjectId_2 + aggregationFunctions: + - name: count + returnType: Int! + dataConnectorAggregationFunctionMapping: + - dataConnectorName: test_cases + dataConnectorScalarType: ObjectId + functionMapping: + count: + name: count + count: + enable: true + countDistinct: + enable: true + graphql: + selectTypeName: ObjectIdAggExp2 + diff --git a/fixtures/hasura/test_cases/metadata/test_cases.hml b/fixtures/hasura/app/metadata/test_cases.hml similarity index 97% rename from fixtures/hasura/test_cases/metadata/test_cases.hml rename to fixtures/hasura/app/metadata/test_cases.hml index baf4c95d..fe00f6f2 100644 --- a/fixtures/hasura/test_cases/metadata/test_cases.hml +++ b/fixtures/hasura/app/metadata/test_cases.hml @@ -5,9 +5,9 @@ definition: url: readWriteUrls: read: - valueFromEnv: TEST_CASES_CONNECTOR_URL + valueFromEnv: APP_TEST_CASES_READ_URL write: - valueFromEnv: TEST_CASES_CONNECTOR_URL + valueFromEnv: APP_TEST_CASES_WRITE_URL schema: version: v0.1 schema: @@ -770,6 +770,12 @@ definition: name: String weird_field_names: fields: + $invalid.array: + type: + type: array + element_type: + type: named + name: weird_field_names_$invalid.array $invalid.name: type: type: named @@ -786,6 +792,12 @@ definition: type: type: named name: weird_field_names_valid_object_name + weird_field_names_$invalid.array: + fields: + $invalid.element: + type: + type: named + name: Int weird_field_names_$invalid.object.name: fields: valid_name: @@ -835,6 +847,8 @@ definition: nested_fields: filter_by: {} order_by: {} + exists: + nested_collections: {} mutation: {} relationships: relation_comparisons: {} diff --git a/fixtures/hasura/app/subgraph.yaml b/fixtures/hasura/app/subgraph.yaml new file mode 100644 index 00000000..a194ab54 --- /dev/null +++ b/fixtures/hasura/app/subgraph.yaml @@ -0,0 +1,29 @@ +kind: Subgraph +version: v2 +definition: + name: app + generator: + rootPath: . + namingConvention: graphql + includePaths: + - metadata + envMapping: + APP_CHINOOK_READ_URL: + fromEnv: APP_CHINOOK_READ_URL + APP_CHINOOK_WRITE_URL: + fromEnv: APP_CHINOOK_WRITE_URL + APP_SAMPLE_MFLIX_READ_URL: + fromEnv: APP_SAMPLE_MFLIX_READ_URL + APP_SAMPLE_MFLIX_WRITE_URL: + fromEnv: APP_SAMPLE_MFLIX_WRITE_URL + APP_TEST_CASES_READ_URL: + fromEnv: APP_TEST_CASES_READ_URL + APP_TEST_CASES_WRITE_URL: + fromEnv: APP_TEST_CASES_WRITE_URL + connectors: + - path: connector/sample_mflix/connector.yaml + connectorLinkName: sample_mflix + - path: connector/chinook/connector.yaml + connectorLinkName: chinook + - path: connector/test_cases/connector.yaml + connectorLinkName: test_cases diff --git a/fixtures/hasura/chinook/.env.chinook b/fixtures/hasura/chinook/.env.chinook deleted file mode 100644 index b52c724f..00000000 --- a/fixtures/hasura/chinook/.env.chinook +++ /dev/null @@ -1 +0,0 @@ -CHINOOK_CONNECTOR_URL='http://localhost:7131' diff --git a/fixtures/hasura/chinook/connector/.ddnignore b/fixtures/hasura/chinook/connector/.ddnignore deleted file mode 100644 index 4c49bd78..00000000 --- a/fixtures/hasura/chinook/connector/.ddnignore +++ /dev/null @@ -1 +0,0 @@ -.env diff --git a/fixtures/hasura/chinook/connector/.env b/fixtures/hasura/chinook/connector/.env deleted file mode 100644 index ee57a147..00000000 --- a/fixtures/hasura/chinook/connector/.env +++ /dev/null @@ -1 +0,0 @@ -MONGODB_DATABASE_URI="mongodb://localhost/chinook" diff --git a/fixtures/hasura/chinook/connector/connector.yaml b/fixtures/hasura/chinook/connector/connector.yaml deleted file mode 100644 index 078bf6e8..00000000 --- a/fixtures/hasura/chinook/connector/connector.yaml +++ /dev/null @@ -1,8 +0,0 @@ -kind: Connector -version: v1 -definition: - name: chinook - subgraph: chinook - source: hasura/mongodb:v0.1.0 - context: . - envFile: .env diff --git a/fixtures/hasura/common/metadata/scalar-types/Date.hml b/fixtures/hasura/common/metadata/scalar-types/Date.hml deleted file mode 100644 index d94fa9d6..00000000 --- a/fixtures/hasura/common/metadata/scalar-types/Date.hml +++ /dev/null @@ -1,132 +0,0 @@ ---- -kind: ScalarType -version: v1 -definition: - name: Date - graphql: - typeName: Date - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: chinook - dataConnectorScalarType: Date - representation: Date - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: sample_mflix - dataConnectorScalarType: Date - representation: Date - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: test_cases - dataConnectorScalarType: Date - representation: Date - ---- -kind: BooleanExpressionType -version: v1 -definition: - name: DateComparisonExp - operand: - scalar: - type: Date - comparisonOperators: - - name: _eq - argumentType: Date - - name: _neq - argumentType: Date - - name: _in - argumentType: "[Date!]!" - - name: _nin - argumentType: "[Date!]!" - - name: _gt - argumentType: Date - - name: _gte - argumentType: Date - - name: _lt - argumentType: Date - - name: _lte - argumentType: Date - dataConnectorOperatorMapping: - - dataConnectorName: chinook - dataConnectorScalarType: Date - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - _gt: _gt - _gte: _gte - _lt: _lt - _lte: _lte - - dataConnectorName: sample_mflix - dataConnectorScalarType: Date - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - _gt: _gt - _gte: _gte - _lt: _lt - _lte: _lte - - dataConnectorName: test_cases - dataConnectorScalarType: Date - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - _gt: _gt - _gte: _gte - _lt: _lt - _lte: _lte - logicalOperators: - enable: true - isNull: - enable: true - graphql: - typeName: DateComparisonExp - ---- -kind: AggregateExpression -version: v1 -definition: - name: DateAggregateExp - operand: - scalar: - aggregatedType: Date - aggregationFunctions: - - name: _max - returnType: Date - - name: _min - returnType: Date - dataConnectorAggregationFunctionMapping: - - dataConnectorName: chinook - dataConnectorScalarType: Date - functionMapping: - _max: { name: max } - _min: { name: min } - - dataConnectorName: sample_mflix - dataConnectorScalarType: Date - functionMapping: - _max: { name: max } - _min: { name: min } - - dataConnectorName: test_cases - dataConnectorScalarType: Date - functionMapping: - _max: { name: max } - _min: { name: min } - count: { enable: true } - countDistinct: { enable: true } - graphql: - selectTypeName: DateAggregateExp - diff --git a/fixtures/hasura/common/metadata/scalar-types/Decimal.hml b/fixtures/hasura/common/metadata/scalar-types/Decimal.hml deleted file mode 100644 index f41ef2a5..00000000 --- a/fixtures/hasura/common/metadata/scalar-types/Decimal.hml +++ /dev/null @@ -1,141 +0,0 @@ ---- -kind: ScalarType -version: v1 -definition: - name: Decimal - graphql: - typeName: Decimal - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: chinook - dataConnectorScalarType: Decimal - representation: Decimal - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: sample_mflix - dataConnectorScalarType: Decimal - representation: Decimal - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: test_cases - dataConnectorScalarType: Decimal - representation: Decimal - ---- -kind: BooleanExpressionType -version: v1 -definition: - name: DecimalComparisonExp - operand: - scalar: - type: Decimal - comparisonOperators: - - name: _eq - argumentType: Decimal - - name: _neq - argumentType: Decimal - - name: _in - argumentType: "[Decimal!]!" - - name: _nin - argumentType: "[Decimal!]!" - - name: _gt - argumentType: Decimal - - name: _gte - argumentType: Decimal - - name: _lt - argumentType: Decimal - - name: _lte - argumentType: Decimal - dataConnectorOperatorMapping: - - dataConnectorName: chinook - dataConnectorScalarType: Decimal - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - _gt: _gt - _gte: _gte - _lt: _lt - _lte: _lte - - dataConnectorName: sample_mflix - dataConnectorScalarType: Decimal - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - _gt: _gt - _gte: _gte - _lt: _lt - _lte: _lte - - dataConnectorName: test_cases - dataConnectorScalarType: Decimal - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - _gt: _gt - _gte: _gte - _lt: _lt - _lte: _lte - logicalOperators: - enable: true - isNull: - enable: true - graphql: - typeName: DecimalComparisonExp - ---- -kind: AggregateExpression -version: v1 -definition: - name: DecimalAggregateExp - operand: - scalar: - aggregatedType: Decimal - aggregationFunctions: - - name: _avg - returnType: Decimal - - name: _max - returnType: Decimal - - name: _min - returnType: Decimal - - name: _sum - returnType: Decimal - dataConnectorAggregationFunctionMapping: - - dataConnectorName: chinook - dataConnectorScalarType: Decimal - functionMapping: - _avg: { name: avg } - _max: { name: max } - _min: { name: min } - _sum: { name: sum } - - dataConnectorName: sample_mflix - dataConnectorScalarType: Decimal - functionMapping: - _avg: { name: avg } - _max: { name: max } - _min: { name: min } - _sum: { name: sum } - - dataConnectorName: test_cases - dataConnectorScalarType: Decimal - functionMapping: - _avg: { name: avg } - _max: { name: max } - _min: { name: min } - _sum: { name: sum } - count: { enable: true } - countDistinct: { enable: true } - graphql: - selectTypeName: DecimalAggregateExp diff --git a/fixtures/hasura/common/metadata/scalar-types/Double.hml b/fixtures/hasura/common/metadata/scalar-types/Double.hml deleted file mode 100644 index a72f1887..00000000 --- a/fixtures/hasura/common/metadata/scalar-types/Double.hml +++ /dev/null @@ -1,133 +0,0 @@ ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: chinook - dataConnectorScalarType: Double - representation: Float - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: sample_mflix - dataConnectorScalarType: Double - representation: Float - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: test_cases - dataConnectorScalarType: Double - representation: Float - ---- -kind: BooleanExpressionType -version: v1 -definition: - name: FloatComparisonExp - operand: - scalar: - type: Float - comparisonOperators: - - name: _eq - argumentType: Float - - name: _neq - argumentType: Float - - name: _in - argumentType: "[Float!]!" - - name: _nin - argumentType: "[Float!]!" - - name: _gt - argumentType: Float - - name: _gte - argumentType: Float - - name: _lt - argumentType: Float - - name: _lte - argumentType: Float - dataConnectorOperatorMapping: - - dataConnectorName: chinook - dataConnectorScalarType: Double - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - _gt: _gt - _gte: _gte - _lt: _lt - _lte: _lte - - dataConnectorName: sample_mflix - dataConnectorScalarType: Double - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - _gt: _gt - _gte: _gte - _lt: _lt - _lte: _lte - - dataConnectorName: test_cases - dataConnectorScalarType: Double - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - _gt: _gt - _gte: _gte - _lt: _lt - _lte: _lte - logicalOperators: - enable: true - isNull: - enable: true - graphql: - typeName: DoubleComparisonExp - ---- -kind: AggregateExpression -version: v1 -definition: - name: FloatAggregateExp - operand: - scalar: - aggregatedType: Float - aggregationFunctions: - - name: _avg - returnType: Float - - name: _max - returnType: Float - - name: _min - returnType: Float - - name: _sum - returnType: Float - dataConnectorAggregationFunctionMapping: - - dataConnectorName: chinook - dataConnectorScalarType: Double - functionMapping: - _avg: { name: avg } - _max: { name: max } - _min: { name: min } - _sum: { name: sum } - - dataConnectorName: sample_mflix - dataConnectorScalarType: Double - functionMapping: - _avg: { name: avg } - _max: { name: max } - _min: { name: min } - _sum: { name: sum } - - dataConnectorName: test_cases - dataConnectorScalarType: Double - functionMapping: - _avg: { name: avg } - _max: { name: max } - _min: { name: min } - _sum: { name: sum } - count: { enable: true } - countDistinct: { enable: true } - graphql: - selectTypeName: FloatAggregateExp diff --git a/fixtures/hasura/common/metadata/scalar-types/ExtendedJSON.hml b/fixtures/hasura/common/metadata/scalar-types/ExtendedJSON.hml deleted file mode 100644 index 915a0819..00000000 --- a/fixtures/hasura/common/metadata/scalar-types/ExtendedJSON.hml +++ /dev/null @@ -1,151 +0,0 @@ ---- -kind: ScalarType -version: v1 -definition: - name: ExtendedJSON - graphql: - typeName: ExtendedJSON - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: chinook - dataConnectorScalarType: ExtendedJSON - representation: ExtendedJSON - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: sample_mflix - dataConnectorScalarType: ExtendedJSON - representation: ExtendedJSON - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: test_cases - dataConnectorScalarType: ExtendedJSON - representation: ExtendedJSON - ---- -kind: BooleanExpressionType -version: v1 -definition: - name: ExtendedJsonComparisonExp - operand: - scalar: - type: ExtendedJSON - comparisonOperators: - - name: _eq - argumentType: ExtendedJSON - - name: _neq - argumentType: ExtendedJSON - - name: _in - argumentType: "[ExtendedJSON!]!" - - name: _nin - argumentType: "[ExtendedJSON!]!" - - name: _gt - argumentType: ExtendedJSON - - name: _gte - argumentType: ExtendedJSON - - name: _lt - argumentType: ExtendedJSON - - name: _lte - argumentType: ExtendedJSON - - name: _regex - argumentType: String - - name: _iregex - argumentType: String - dataConnectorOperatorMapping: - - dataConnectorName: chinook - dataConnectorScalarType: ExtendedJSON - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - _gt: _gt - _gte: _gte - _lt: _lt - _lte: _lte - _regex: _regex - _iregex: _iregex - - dataConnectorName: sample_mflix - dataConnectorScalarType: ExtendedJSON - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - _gt: _gt - _gte: _gte - _lt: _lt - _lte: _lte - _regex: _regex - _iregex: _iregex - - dataConnectorName: test_cases - dataConnectorScalarType: ExtendedJSON - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - _gt: _gt - _gte: _gte - _lt: _lt - _lte: _lte - _regex: _regex - _iregex: _iregex - logicalOperators: - enable: true - isNull: - enable: true - graphql: - typeName: ExtendedJsonComparisonExp - ---- -kind: AggregateExpression -version: v1 -definition: - name: ExtendedJsonAggregateExp - operand: - scalar: - aggregatedType: ExtendedJSON - aggregationFunctions: - - name: _avg - returnType: ExtendedJSON - - name: _max - returnType: ExtendedJSON - - name: _min - returnType: ExtendedJSON - - name: _sum - returnType: ExtendedJSON - dataConnectorAggregationFunctionMapping: - - dataConnectorName: chinook - dataConnectorScalarType: ExtendedJSON - functionMapping: - _avg: { name: avg } - _max: { name: max } - _min: { name: min } - _sum: { name: sum } - - dataConnectorName: sample_mflix - dataConnectorScalarType: ExtendedJSON - functionMapping: - _avg: { name: avg } - _max: { name: max } - _min: { name: min } - _sum: { name: sum } - - dataConnectorName: test_cases - dataConnectorScalarType: ExtendedJSON - functionMapping: - _avg: { name: avg } - _max: { name: max } - _min: { name: min } - _sum: { name: sum } - count: { enable: true } - countDistinct: { enable: true } - graphql: - selectTypeName: ExtendedJsonAggregateExp diff --git a/fixtures/hasura/common/metadata/scalar-types/Int.hml b/fixtures/hasura/common/metadata/scalar-types/Int.hml deleted file mode 100644 index 658fa3e8..00000000 --- a/fixtures/hasura/common/metadata/scalar-types/Int.hml +++ /dev/null @@ -1,133 +0,0 @@ ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: chinook - dataConnectorScalarType: Int - representation: Int - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: sample_mflix - dataConnectorScalarType: Int - representation: Int - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: test_cases - dataConnectorScalarType: Int - representation: Int - ---- -kind: BooleanExpressionType -version: v1 -definition: - name: IntComparisonExp - operand: - scalar: - type: Int - comparisonOperators: - - name: _eq - argumentType: Int - - name: _neq - argumentType: Int - - name: _in - argumentType: "[Int!]!" - - name: _nin - argumentType: "[Int!]!" - - name: _gt - argumentType: Int - - name: _gte - argumentType: Int - - name: _lt - argumentType: Int - - name: _lte - argumentType: Int - dataConnectorOperatorMapping: - - dataConnectorName: chinook - dataConnectorScalarType: Int - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - _gt: _gt - _gte: _gte - _lt: _lt - _lte: _lte - - dataConnectorName: sample_mflix - dataConnectorScalarType: Int - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - _gt: _gt - _gte: _gte - _lt: _lt - _lte: _lte - - dataConnectorName: test_cases - dataConnectorScalarType: Int - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - _gt: _gt - _gte: _gte - _lt: _lt - _lte: _lte - logicalOperators: - enable: true - isNull: - enable: true - graphql: - typeName: IntComparisonExp - ---- -kind: AggregateExpression -version: v1 -definition: - name: IntAggregateExp - operand: - scalar: - aggregatedType: Int - aggregationFunctions: - - name: _avg - returnType: Int - - name: _max - returnType: Int - - name: _min - returnType: Int - - name: _sum - returnType: Int - dataConnectorAggregationFunctionMapping: - - dataConnectorName: chinook - dataConnectorScalarType: Int - functionMapping: - _avg: { name: avg } - _max: { name: max } - _min: { name: min } - _sum: { name: sum } - - dataConnectorName: sample_mflix - dataConnectorScalarType: Int - functionMapping: - _avg: { name: avg } - _max: { name: max } - _min: { name: min } - _sum: { name: sum } - - dataConnectorName: test_cases - dataConnectorScalarType: Int - functionMapping: - _avg: { name: avg } - _max: { name: max } - _min: { name: min } - _sum: { name: sum } - count: { enable: true } - countDistinct: { enable: true } - graphql: - selectTypeName: IntAggregateExp diff --git a/fixtures/hasura/common/metadata/scalar-types/ObjectId.hml b/fixtures/hasura/common/metadata/scalar-types/ObjectId.hml deleted file mode 100644 index 3db6dd95..00000000 --- a/fixtures/hasura/common/metadata/scalar-types/ObjectId.hml +++ /dev/null @@ -1,77 +0,0 @@ ---- -kind: ScalarType -version: v1 -definition: - name: ObjectId - graphql: - typeName: ObjectId - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: chinook - dataConnectorScalarType: ObjectId - representation: ObjectId - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: sample_mflix - dataConnectorScalarType: ObjectId - representation: ObjectId - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: test_cases - dataConnectorScalarType: ObjectId - representation: ObjectId - ---- -kind: BooleanExpressionType -version: v1 -definition: - name: ObjectIdComparisonExp - operand: - scalar: - type: ObjectId - comparisonOperators: - - name: _eq - argumentType: ObjectId - - name: _neq - argumentType: ObjectId - - name: _in - argumentType: "[ObjectId!]!" - - name: _nin - argumentType: "[ObjectId!]!" - dataConnectorOperatorMapping: - - dataConnectorName: chinook - dataConnectorScalarType: ObjectId - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - - dataConnectorName: sample_mflix - dataConnectorScalarType: ObjectId - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - - dataConnectorName: test_cases - dataConnectorScalarType: ObjectId - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - logicalOperators: - enable: true - isNull: - enable: true - graphql: - typeName: ObjectIdComparisonExp diff --git a/fixtures/hasura/common/metadata/scalar-types/String.hml b/fixtures/hasura/common/metadata/scalar-types/String.hml deleted file mode 100644 index 12114802..00000000 --- a/fixtures/hasura/common/metadata/scalar-types/String.hml +++ /dev/null @@ -1,99 +0,0 @@ ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: chinook - dataConnectorScalarType: String - representation: String - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: sample_mflix - dataConnectorScalarType: String - representation: String - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: test_cases - dataConnectorScalarType: String - representation: String - ---- -kind: BooleanExpressionType -version: v1 -definition: - name: StringComparisonExp - operand: - scalar: - type: String - comparisonOperators: - - name: _eq - argumentType: String - - name: _neq - argumentType: String - - name: _in - argumentType: "[String!]!" - - name: _nin - argumentType: "[String!]!" - - name: _gt - argumentType: String - - name: _gte - argumentType: String - - name: _lt - argumentType: String - - name: _lte - argumentType: String - - name: _regex - argumentType: String - - name: _iregex - argumentType: String - dataConnectorOperatorMapping: - - dataConnectorName: chinook - dataConnectorScalarType: String - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - _gt: _gt - _gte: _gte - _lt: _lt - _lte: _lte - _regex: _regex - _iregex: _iregex - - dataConnectorName: sample_mflix - dataConnectorScalarType: String - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - _gt: _gt - _gte: _gte - _lt: _lt - _lte: _lte - _regex: _regex - _iregex: _iregex - - dataConnectorName: test_cases - dataConnectorScalarType: String - operatorMapping: - _eq: _eq - _neq: _neq - _in: _in - _nin: _nin - _gt: _gt - _gte: _gte - _lt: _lt - _lte: _lte - _regex: _regex - _iregex: _iregex - logicalOperators: - enable: true - isNull: - enable: true - graphql: - typeName: StringComparisonExp diff --git a/fixtures/hasura/compose.yaml b/fixtures/hasura/compose.yaml new file mode 100644 index 00000000..443d0742 --- /dev/null +++ b/fixtures/hasura/compose.yaml @@ -0,0 +1,41 @@ +include: + - path: app/connector/sample_mflix/compose.yaml + - path: app/connector/chinook/compose.yaml + - path: app/connector/test_cases/compose.yaml +services: + engine: + build: + context: engine + dockerfile: Dockerfile.engine + pull: true + environment: + AUTHN_CONFIG_PATH: /md/auth_config.json + ENABLE_CORS: "true" + ENABLE_SQL_INTERFACE: "true" + INTROSPECTION_METADATA_FILE: /md/metadata.json + METADATA_PATH: /md/open_dd.json + OTLP_ENDPOINT: http://local.hasura.dev:4317 + extra_hosts: + - local.hasura.dev:host-gateway + labels: + io.hasura.ddn.service-name: engine + ports: + - 3280:3000 + mongodb: + container_name: mongodb + image: mongo:latest + ports: + - 27017:27017 + volumes: + - ../mongodb:/docker-entrypoint-initdb.d:ro + otel-collector: + command: + - --config=/etc/otel-collector-config.yaml + environment: + HASURA_DDN_PAT: ${HASURA_DDN_PAT} + image: otel/opentelemetry-collector:0.104.0 + ports: + - 4317:4317 + - 4318:4318 + volumes: + - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml diff --git a/fixtures/hasura/engine/.env.engine b/fixtures/hasura/engine/.env.engine deleted file mode 100644 index 14d6bfc3..00000000 --- a/fixtures/hasura/engine/.env.engine +++ /dev/null @@ -1,5 +0,0 @@ -METADATA_PATH=/md/open_dd.json -AUTHN_CONFIG_PATH=/md/auth_config.json -INTROSPECTION_METADATA_FILE=/md/metadata.json -OTLP_ENDPOINT=http://local.hasura.dev:4317 -ENABLE_CORS=true diff --git a/fixtures/hasura/engine/Dockerfile.engine b/fixtures/hasura/engine/Dockerfile.engine new file mode 100644 index 00000000..3613f0ec --- /dev/null +++ b/fixtures/hasura/engine/Dockerfile.engine @@ -0,0 +1,2 @@ +FROM ghcr.io/hasura/v3-engine +COPY ./build /md/ \ No newline at end of file diff --git a/fixtures/hasura/engine/auth_config.json b/fixtures/hasura/engine/auth_config.json deleted file mode 100644 index 8a73e5b4..00000000 --- a/fixtures/hasura/engine/auth_config.json +++ /dev/null @@ -1 +0,0 @@ -{"version":"v1","definition":{"allowRoleEmulationBy":"admin","mode":{"webhook":{"url":"http://auth_hook:3050/validate-request","method":"Post"}}}} \ No newline at end of file diff --git a/fixtures/hasura/engine/metadata.json b/fixtures/hasura/engine/metadata.json deleted file mode 100644 index 84b41230..00000000 --- a/fixtures/hasura/engine/metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"subgraphs":[{"name":"globals","objects":[{"definition":{"apolloFederation":null,"mutation":{"rootOperationTypeName":"Mutation"},"query":{"aggregate":null,"argumentsInput":{"fieldName":"args"},"filterInput":{"fieldName":"where","operatorNames":{"and":"_and","isNull":"_is_null","not":"_not","or":"_or"}},"limitInput":{"fieldName":"limit"},"offsetInput":{"fieldName":"offset"},"orderByInput":{"enumDirectionValues":{"asc":"Asc","desc":"Desc"},"enumTypeNames":[{"directions":["Asc","Desc"],"typeName":"OrderBy"}],"fieldName":"order_by"},"rootOperationTypeName":"Query"}},"kind":"GraphqlConfig","version":"v1"},{"definition":{"allowRoleEmulationBy":"admin","mode":{"webhook":{"method":"Post","url":"http://auth_hook:3050/validate-request"}}},"kind":"AuthConfig","version":"v1"},{"date":"2024-07-09","kind":"CompatibilityConfig"}]}],"version":"v2"} \ No newline at end of file diff --git a/fixtures/hasura/engine/open_dd.json b/fixtures/hasura/engine/open_dd.json deleted file mode 100644 index 508184df..00000000 --- a/fixtures/hasura/engine/open_dd.json +++ /dev/null @@ -1 +0,0 @@ -{"version":"v3","subgraphs":[{"name":"globals","objects":[{"kind":"GraphqlConfig","version":"v1","definition":{"query":{"rootOperationTypeName":"Query","argumentsInput":{"fieldName":"args"},"limitInput":{"fieldName":"limit"},"offsetInput":{"fieldName":"offset"},"filterInput":{"fieldName":"where","operatorNames":{"and":"_and","or":"_or","not":"_not","isNull":"_is_null"}},"orderByInput":{"fieldName":"order_by","enumDirectionValues":{"asc":"Asc","desc":"Desc"},"enumTypeNames":[{"directions":["Asc","Desc"],"typeName":"OrderBy"}]},"aggregate":null},"mutation":{"rootOperationTypeName":"Mutation"},"apolloFederation":null}}]}],"flags":{"require_graphql_config":true}} \ No newline at end of file diff --git a/fixtures/hasura/globals/.env.globals.local b/fixtures/hasura/globals/.env.globals.local deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/hasura/globals/auth-config.cloud.hml b/fixtures/hasura/globals/auth-config.cloud.hml deleted file mode 100644 index 1080ecc3..00000000 --- a/fixtures/hasura/globals/auth-config.cloud.hml +++ /dev/null @@ -1,8 +0,0 @@ -kind: AuthConfig -version: v1 -definition: - allowRoleEmulationBy: admin - mode: - webhook: - url: http://auth-hook.default:8080/webhook/ddn?role=admin - method: Post diff --git a/fixtures/hasura/globals/auth-config.local.hml b/fixtures/hasura/globals/auth-config.local.hml deleted file mode 100644 index 367e5064..00000000 --- a/fixtures/hasura/globals/auth-config.local.hml +++ /dev/null @@ -1,8 +0,0 @@ -kind: AuthConfig -version: v1 -definition: - allowRoleEmulationBy: admin - mode: - webhook: - url: http://auth_hook:3050/validate-request - method: Post diff --git a/fixtures/hasura/globals/metadata/auth-config.hml b/fixtures/hasura/globals/metadata/auth-config.hml new file mode 100644 index 00000000..54c0b84b --- /dev/null +++ b/fixtures/hasura/globals/metadata/auth-config.hml @@ -0,0 +1,7 @@ +kind: AuthConfig +version: v2 +definition: + mode: + noAuth: + role: admin + sessionVariables: {} diff --git a/fixtures/hasura/globals/compatibility-config.hml b/fixtures/hasura/globals/metadata/compatibility-config.hml similarity index 57% rename from fixtures/hasura/globals/compatibility-config.hml rename to fixtures/hasura/globals/metadata/compatibility-config.hml index 80856ac1..ca10adf3 100644 --- a/fixtures/hasura/globals/compatibility-config.hml +++ b/fixtures/hasura/globals/metadata/compatibility-config.hml @@ -1,2 +1,2 @@ kind: CompatibilityConfig -date: "2024-07-09" +date: "2024-11-26" diff --git a/fixtures/hasura/globals/graphql-config.hml b/fixtures/hasura/globals/metadata/graphql-config.hml similarity index 76% rename from fixtures/hasura/globals/graphql-config.hml rename to fixtures/hasura/globals/metadata/graphql-config.hml index d5b9d9f6..f54210cf 100644 --- a/fixtures/hasura/globals/graphql-config.hml +++ b/fixtures/hasura/globals/metadata/graphql-config.hml @@ -26,5 +26,11 @@ definition: - Asc - Desc typeName: OrderBy + aggregate: + filterInputFieldName: filter_input + countFieldName: _count + countDistinctFieldName: _count_distinct mutation: rootOperationTypeName: Mutation + subscription: + rootOperationTypeName: Subscription diff --git a/fixtures/hasura/globals/subgraph.cloud.yaml b/fixtures/hasura/globals/subgraph.cloud.yaml deleted file mode 100644 index dea2c3d4..00000000 --- a/fixtures/hasura/globals/subgraph.cloud.yaml +++ /dev/null @@ -1,11 +0,0 @@ -kind: Subgraph -version: v1 -definition: - generator: - rootPath: . - envFile: .env.globals.cloud - includePaths: - - auth-config.cloud.hml - - compatibility-config.hml - - graphql-config.hml - name: globals diff --git a/fixtures/hasura/globals/subgraph.local.yaml b/fixtures/hasura/globals/subgraph.local.yaml deleted file mode 100644 index d5e4d000..00000000 --- a/fixtures/hasura/globals/subgraph.local.yaml +++ /dev/null @@ -1,11 +0,0 @@ -kind: Subgraph -version: v1 -definition: - generator: - rootPath: . - envFile: .env.globals.local - includePaths: - - auth-config.local.hml - - compatibility-config.hml - - graphql-config.hml - name: globals diff --git a/fixtures/hasura/chinook/subgraph.yaml b/fixtures/hasura/globals/subgraph.yaml similarity index 86% rename from fixtures/hasura/chinook/subgraph.yaml rename to fixtures/hasura/globals/subgraph.yaml index 26324e9c..b21faca2 100644 --- a/fixtures/hasura/chinook/subgraph.yaml +++ b/fixtures/hasura/globals/subgraph.yaml @@ -1,8 +1,8 @@ kind: Subgraph version: v2 definition: + name: globals generator: rootPath: . includePaths: - metadata - name: chinook diff --git a/fixtures/hasura/hasura.yaml b/fixtures/hasura/hasura.yaml index b4d4e478..7f8f5cc6 100644 --- a/fixtures/hasura/hasura.yaml +++ b/fixtures/hasura/hasura.yaml @@ -1 +1 @@ -version: v2 +version: v3 diff --git a/fixtures/hasura/otel-collector-config.yaml b/fixtures/hasura/otel-collector-config.yaml new file mode 100644 index 00000000..2af072db --- /dev/null +++ b/fixtures/hasura/otel-collector-config.yaml @@ -0,0 +1,23 @@ +exporters: + otlp: + endpoint: https://gateway.otlp.hasura.io:443 + headers: + Authorization: pat ${env:HASURA_DDN_PAT} +processors: + batch: {} +receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + http: + endpoint: 0.0.0.0:4318 +service: + pipelines: + traces: + exporters: + - otlp + processors: + - batch + receivers: + - otlp diff --git a/fixtures/hasura/sample_mflix/.env.sample_mflix b/fixtures/hasura/sample_mflix/.env.sample_mflix deleted file mode 100644 index e003fd5a..00000000 --- a/fixtures/hasura/sample_mflix/.env.sample_mflix +++ /dev/null @@ -1 +0,0 @@ -SAMPLE_MFLIX_CONNECTOR_URL='http://localhost:7130' diff --git a/fixtures/hasura/sample_mflix/connector/.ddnignore b/fixtures/hasura/sample_mflix/connector/.ddnignore deleted file mode 100644 index 4c49bd78..00000000 --- a/fixtures/hasura/sample_mflix/connector/.ddnignore +++ /dev/null @@ -1 +0,0 @@ -.env diff --git a/fixtures/hasura/sample_mflix/connector/.env b/fixtures/hasura/sample_mflix/connector/.env deleted file mode 100644 index fea5fc4a..00000000 --- a/fixtures/hasura/sample_mflix/connector/.env +++ /dev/null @@ -1 +0,0 @@ -MONGODB_DATABASE_URI="mongodb://localhost/sample_mflix" diff --git a/fixtures/hasura/sample_mflix/connector/connector.yaml b/fixtures/hasura/sample_mflix/connector/connector.yaml deleted file mode 100644 index 052dfcd6..00000000 --- a/fixtures/hasura/sample_mflix/connector/connector.yaml +++ /dev/null @@ -1,8 +0,0 @@ -kind: Connector -version: v1 -definition: - name: sample_mflix - subgraph: sample_mflix - source: hasura/mongodb:v0.1.0 - context: . - envFile: .env diff --git a/fixtures/hasura/sample_mflix/metadata/models/TitleWordFrequency.hml b/fixtures/hasura/sample_mflix/metadata/models/TitleWordFrequency.hml deleted file mode 100644 index 294e8448..00000000 --- a/fixtures/hasura/sample_mflix/metadata/models/TitleWordFrequency.hml +++ /dev/null @@ -1,94 +0,0 @@ ---- -kind: ObjectType -version: v1 -definition: - name: TitleWordFrequency - fields: - - name: word - type: String! - - name: count - type: Int! - graphql: - typeName: TitleWordFrequency - inputTypeName: TitleWordFrequencyInput - dataConnectorTypeMapping: - - dataConnectorName: sample_mflix - dataConnectorObjectType: TitleWordFrequency - fieldMapping: - word: - column: - name: _id - count: - column: - name: count - ---- -kind: TypePermissions -version: v1 -definition: - typeName: TitleWordFrequency - permissions: - - role: admin - output: - allowedFields: - - word - - count - ---- -kind: BooleanExpressionType -version: v1 -definition: - name: TitleWordFrequencyComparisonExp - operand: - object: - type: TitleWordFrequency - comparableFields: - - fieldName: word - booleanExpressionType: StringComparisonExp - - fieldName: count - booleanExpressionType: IntComparisonExp - comparableRelationships: [] - logicalOperators: - enable: true - isNull: - enable: true - graphql: - typeName: TitleWordFrequencyComparisonExp - ---- -kind: Model -version: v1 -definition: - name: TitleWordFrequency - objectType: TitleWordFrequency - source: - dataConnectorName: sample_mflix - collection: title_word_frequency - filterExpressionType: TitleWordFrequencyComparisonExp - orderableFields: - - fieldName: word - orderByDirections: - enableAll: true - - fieldName: count - orderByDirections: - enableAll: true - graphql: - selectMany: - queryRootField: title_word_frequencies - selectUniques: - - queryRootField: title_word_frequency - uniqueIdentifier: - - word - orderByExpressionType: TitleWordFrequencyOrderBy - description: words appearing in movie titles with counts - ---- -kind: ModelPermissions -version: v1 -definition: - modelName: TitleWordFrequency - permissions: - - role: admin - select: - filter: null - diff --git a/fixtures/hasura/sample_mflix/subgraph.yaml b/fixtures/hasura/sample_mflix/subgraph.yaml deleted file mode 100644 index f91cd615..00000000 --- a/fixtures/hasura/sample_mflix/subgraph.yaml +++ /dev/null @@ -1,8 +0,0 @@ -kind: Subgraph -version: v2 -definition: - generator: - rootPath: . - includePaths: - - metadata - name: sample_mflix diff --git a/fixtures/hasura/supergraph.yaml b/fixtures/hasura/supergraph.yaml index 94840e70..0d9260e6 100644 --- a/fixtures/hasura/supergraph.yaml +++ b/fixtures/hasura/supergraph.yaml @@ -2,6 +2,5 @@ kind: Supergraph version: v2 definition: subgraphs: - - globals/subgraph.local.yaml - - chinook/subgraph.local.yaml - - sample_mflix/subgraph.local.yaml + - globals/subgraph.yaml + - app/subgraph.yaml diff --git a/fixtures/hasura/test_cases/.env.test_cases b/fixtures/hasura/test_cases/.env.test_cases deleted file mode 100644 index 3df0caa2..00000000 --- a/fixtures/hasura/test_cases/.env.test_cases +++ /dev/null @@ -1 +0,0 @@ -TEST_CASES_CONNECTOR_URL='http://localhost:7132' diff --git a/fixtures/hasura/test_cases/connector/.ddnignore b/fixtures/hasura/test_cases/connector/.ddnignore deleted file mode 100644 index 4c49bd78..00000000 --- a/fixtures/hasura/test_cases/connector/.ddnignore +++ /dev/null @@ -1 +0,0 @@ -.env diff --git a/fixtures/hasura/test_cases/connector/.env b/fixtures/hasura/test_cases/connector/.env deleted file mode 100644 index 74da2101..00000000 --- a/fixtures/hasura/test_cases/connector/.env +++ /dev/null @@ -1 +0,0 @@ -MONGODB_DATABASE_URI="mongodb://localhost/test_cases" diff --git a/fixtures/hasura/test_cases/connector/connector.yaml b/fixtures/hasura/test_cases/connector/connector.yaml deleted file mode 100644 index d54b4c4a..00000000 --- a/fixtures/hasura/test_cases/connector/connector.yaml +++ /dev/null @@ -1,8 +0,0 @@ -kind: Connector -version: v2 -definition: - name: test_cases - subgraph: test_cases - source: hasura/mongodb:v0.1.0 - context: . - envFile: .env diff --git a/fixtures/hasura/test_cases/metadata/models/WeirdFieldNames.hml b/fixtures/hasura/test_cases/metadata/models/WeirdFieldNames.hml deleted file mode 100644 index d66ced1c..00000000 --- a/fixtures/hasura/test_cases/metadata/models/WeirdFieldNames.hml +++ /dev/null @@ -1,170 +0,0 @@ ---- -kind: ObjectType -version: v1 -definition: - name: WeirdFieldNamesInvalidObjectName - fields: - - name: validName - type: Int! - graphql: - typeName: TestCases_WeirdFieldNamesInvalidObjectName - inputTypeName: TestCases_WeirdFieldNamesInvalidObjectNameInput - dataConnectorTypeMapping: - - dataConnectorName: test_cases - dataConnectorObjectType: weird_field_names_$invalid.object.name - fieldMapping: - validName: - column: - name: valid_name - ---- -kind: TypePermissions -version: v1 -definition: - typeName: WeirdFieldNamesInvalidObjectName - permissions: - - role: admin - output: - allowedFields: - - validName - ---- -kind: ObjectType -version: v1 -definition: - name: WeirdFieldNamesValidObjectName - fields: - - name: invalidNestedName - type: Int! - graphql: - typeName: TestCases_WeirdFieldNamesValidObjectName - inputTypeName: TestCases_WeirdFieldNamesValidObjectNameInput - dataConnectorTypeMapping: - - dataConnectorName: test_cases - dataConnectorObjectType: weird_field_names_valid_object_name - fieldMapping: - invalidNestedName: - column: - name: $invalid.nested.name - ---- -kind: TypePermissions -version: v1 -definition: - typeName: WeirdFieldNamesValidObjectName - permissions: - - role: admin - output: - allowedFields: - - invalidNestedName - ---- -kind: ObjectType -version: v1 -definition: - name: WeirdFieldNames - fields: - - name: invalidName - type: Int! - - name: invalidObjectName - type: WeirdFieldNamesInvalidObjectName! - - name: id - type: ObjectId! - - name: validObjectName - type: WeirdFieldNamesValidObjectName! - graphql: - typeName: TestCases_WeirdFieldNames - inputTypeName: TestCases_WeirdFieldNamesInput - dataConnectorTypeMapping: - - dataConnectorName: test_cases - dataConnectorObjectType: weird_field_names - fieldMapping: - invalidName: - column: - name: $invalid.name - invalidObjectName: - column: - name: $invalid.object.name - id: - column: - name: _id - validObjectName: - column: - name: valid_object_name - ---- -kind: TypePermissions -version: v1 -definition: - typeName: WeirdFieldNames - permissions: - - role: admin - output: - allowedFields: - - invalidName - - invalidObjectName - - id - - validObjectName - ---- -kind: BooleanExpressionType -version: v1 -definition: - name: WeirdFieldNamesComparisonExp - operand: - object: - type: WeirdFieldNames - comparableFields: - - fieldName: invalidName - booleanExpressionType: IntComparisonExp - - fieldName: id - booleanExpressionType: ObjectIdComparisonExp - comparableRelationships: [] - logicalOperators: - enable: true - isNull: - enable: true - graphql: - typeName: TestCases_WeirdFieldNamesComparisonExp - ---- -kind: Model -version: v1 -definition: - name: WeirdFieldNames - objectType: WeirdFieldNames - source: - dataConnectorName: test_cases - collection: weird_field_names - filterExpressionType: WeirdFieldNamesComparisonExp - orderableFields: - - fieldName: invalidName - orderByDirections: - enableAll: true - - fieldName: invalidObjectName - orderByDirections: - enableAll: true - - fieldName: id - orderByDirections: - enableAll: true - - fieldName: validObjectName - orderByDirections: - enableAll: true - graphql: - selectMany: - queryRootField: testCases_weirdFieldNames - selectUniques: - - queryRootField: testCases_weirdFieldNamesById - uniqueIdentifier: - - id - orderByExpressionType: TestCases_WeirdFieldNamesOrderBy - ---- -kind: ModelPermissions -version: v1 -definition: - modelName: WeirdFieldNames - permissions: - - role: admin - select: - filter: null diff --git a/fixtures/hasura/test_cases/subgraph.yaml b/fixtures/hasura/test_cases/subgraph.yaml deleted file mode 100644 index 12f327a9..00000000 --- a/fixtures/hasura/test_cases/subgraph.yaml +++ /dev/null @@ -1,8 +0,0 @@ -kind: Subgraph -version: v2 -definition: - generator: - rootPath: . - includePaths: - - metadata - name: test_cases diff --git a/flake.lock b/flake.lock index 7581dd31..e3d798a2 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "advisory-db": { "flake": false, "locked": { - "lastModified": 1720572893, - "narHash": "sha256-EQfU1yMnebn7LoJNjjsQimyuWwz+2YzazqUZu8aX/r4=", + "lastModified": 1733318068, + "narHash": "sha256-liav7uY7CQLqOhmEKc6h0O5ldQBv+RgfndP9RF6W4po=", "owner": "rustsec", "repo": "advisory-db", - "rev": "97a2dc75838f19a5fd63dc3f8e3f57e0c4c8cfe6", + "rev": "f34e88949c5a06c6a2e669ebc50d40cb7f66d050", "type": "github" }, "original": { @@ -26,11 +26,11 @@ ] }, "locked": { - "lastModified": 1720147808, - "narHash": "sha256-hlWEQGUbIwYb+vnd8egzlW/P++yKu3HjV/rOdOPVank=", + "lastModified": 1730775052, + "narHash": "sha256-YXbgfHYJaAXCxrAQzjd03GkSMGd3iGeTmhkMwpFhTPk=", "owner": "hercules-ci", "repo": "arion", - "rev": "236f9dd82d6ef6a2d9987c7a7df3e75f1bc8b318", + "rev": "38ea1d87421f1695743d5eca90b0c37ef3123fbb", "type": "github" }, "original": { @@ -40,17 +40,12 @@ } }, "crane": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, "locked": { - "lastModified": 1720546058, - "narHash": "sha256-iU2yVaPIZm5vMGdlT0+57vdB/aPq/V5oZFBRwYw+HBM=", + "lastModified": 1733286231, + "narHash": "sha256-mlIDSv1/jqWnH8JTiOV7GMUNPCXL25+6jmD+7hdxx5o=", "owner": "ipetkov", "repo": "crane", - "rev": "2d83156f23c43598cf44e152c33a59d3892f8b29", + "rev": "af1556ecda8bcf305820f68ec2f9d77b41d9cc80", "type": "github" }, "original": { @@ -61,11 +56,11 @@ }, "flake-compat": { "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", "owner": "edolstra", "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", "type": "github" }, "original": { @@ -82,11 +77,11 @@ ] }, "locked": { - "lastModified": 1719994518, - "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", + "lastModified": 1730504689, + "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", + "rev": "506278e768c2a08bec68eb62932193e341f55c90", "type": "github" }, "original": { @@ -137,11 +132,11 @@ "graphql-engine-source": { "flake": false, "locked": { - "lastModified": 1725482688, - "narHash": "sha256-O0lGe8SriKV1ScaZvJbpN7pLZa2nQfratOwilWZlJ38=", + "lastModified": 1733318858, + "narHash": "sha256-7/nTrhvRvKnHnDwBxLPpAfwHg06qLyQd3S1iuzQjI5o=", "owner": "hasura", "repo": "graphql-engine", - "rev": "419ce34f5bc9aa121db055d5a548a3fb9a13956c", + "rev": "8b7ad6684f30266326c49208b8c36251b984bb18", "type": "github" }, "original": { @@ -172,11 +167,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1724197678, - "narHash": "sha256-yXS2S3nmHKur+pKgcg3imMz+xBKf211jUEHwtVbWhUk=", + "lastModified": 1733604522, + "narHash": "sha256-9XNxIgOGq8MJ3a1GPE1lGaMBSz6Ossgv/Ec+KhyaC68=", "owner": "hasura", "repo": "ddn-cli-nix", - "rev": "4a1279dbb2fe79f447cd409df710eee3a98fc16e", + "rev": "8e9695beabd6d111a69ae288f8abba6ebf8d1c82", "type": "github" }, "original": { @@ -194,11 +189,11 @@ ] }, "locked": { - "lastModified": 1719226092, - "narHash": "sha256-YNkUMcCUCpnULp40g+svYsaH1RbSEj6s4WdZY/SHe38=", + "lastModified": 1730229744, + "narHash": "sha256-2W//PmgocN9lplDJ7WoiP9EcrfUxqvtxplCAqlwvquY=", "owner": "hercules-ci", "repo": "hercules-ci-effects", - "rev": "11e4b8dc112e2f485d7c97e1cee77f9958f498f5", + "rev": "d70658494391994c7b32e8fe5610dae76737e4df", "type": "github" }, "original": { @@ -225,11 +220,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1720542800, - "narHash": "sha256-ZgnNHuKV6h2+fQ5LuqnUaqZey1Lqqt5dTUAiAnqH0QQ=", + "lastModified": 1733212471, + "narHash": "sha256-M1+uCoV5igihRfcUKrr1riygbe73/dzNnzPsmaLCmpo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "feb2849fdeb70028c70d73b848214b00d324a497", + "rev": "55d15ad12a74eb7d4646254e13638ad0c4128776", "type": "github" }, "original": { @@ -259,11 +254,11 @@ ] }, "locked": { - "lastModified": 1725416653, - "narHash": "sha256-iNBv7ILlZI6ubhW0ExYy8YgiLKUerudxY7n8R5UQK2E=", + "lastModified": 1733279627, + "narHash": "sha256-NCNDAGPkdFdu+DLErbmNbavmVW9AwkgP7azROFFSB0U=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "e5d3f9c2f24d852cddc79716daf0f65ce8468b28", + "rev": "4da5a80ef76039e80468c902f1e9f5c0eab87d96", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 78e84337..e058ed41 100644 --- a/flake.nix +++ b/flake.nix @@ -6,10 +6,7 @@ systems.url = "github:nix-systems/default"; # Nix build system for Rust projects, delegates to cargo - crane = { - url = "github:ipetkov/crane"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + crane.url = "github:ipetkov/crane"; hasura-ddn-cli.url = "github:hasura/ddn-cli-nix"; @@ -106,7 +103,7 @@ # This is useful for building Docker images on Mac developer machines. pkgsCross.linux = mkPkgsLinux final.buildPlatform.system; - ddn = hasura-ddn-cli.defaultPackage.${final.system}; + ddn = hasura-ddn-cli.packages.${final.system}.default; }) ]; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index e1e295f7..0f28fc14 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.80.1" +channel = "1.83.0" profile = "default" # see https://rust-lang.github.io/rustup/concepts/profiles.html components = [] # see https://rust-lang.github.io/rustup/concepts/components.html