From c9bd59185323d6084138bda2e423f6ba8ae5051c Mon Sep 17 00:00:00 2001 From: David Overton Date: Thu, 6 Jun 2024 15:53:34 +1000 Subject: [PATCH 01/34] Update ndc-models and ndc-sdk to v0.1.3 --- Cargo.lock | 42 +++++++----------------------------------- Cargo.toml | 4 ++-- 2 files changed, 9 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d4ce9980..770dffbb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1690,14 +1690,14 @@ dependencies = [ [[package]] name = "ndc-models" -version = "0.1.2" -source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.1.2#6e7d12a31787d5f618099a42ddc0bea786438c00" +version = "0.1.3" +source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.1.3#b9316d206a6aece470531937f6e1ea9223e88122" dependencies = [ "indexmap 2.2.5", "schemars", "serde", "serde_json", - "serde_with 2.3.3", + "serde_with 3.7.0", ] [[package]] @@ -1720,8 +1720,8 @@ dependencies = [ [[package]] name = "ndc-sdk" -version = "0.1.0" -source = "git+https://github.com/hasura/ndc-sdk-rs.git#a273a01efccfc71ef3341cf5f357b2c9ae2d109f" +version = "0.1.3" +source = "git+https://github.com/hasura/ndc-sdk-rs.git?tag=v0.1.3#266f4db31777d2a0885a665e0d982237503b223c" dependencies = [ "async-trait", "axum", @@ -1753,8 +1753,8 @@ dependencies = [ [[package]] name = "ndc-test" -version = "0.1.2" -source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.1.2#6e7d12a31787d5f618099a42ddc0bea786438c00" +version = "0.1.3" +source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.1.3#b9316d206a6aece470531937f6e1ea9223e88122" dependencies = [ "async-trait", "clap", @@ -2785,22 +2785,6 @@ dependencies = [ "serde_with_macros 1.5.2", ] -[[package]] -name = "serde_with" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" -dependencies = [ - "base64 0.13.1", - "chrono", - "hex", - "indexmap 1.9.3", - "serde", - "serde_json", - "serde_with_macros 2.3.3", - "time", -] - [[package]] name = "serde_with" version = "3.7.0" @@ -2831,18 +2815,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "serde_with_macros" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" -dependencies = [ - "darling 0.20.3", - "proc-macro2", - "quote", - "syn 2.0.52", -] - [[package]] name = "serde_with_macros" version = "3.7.0" diff --git a/Cargo.toml b/Cargo.toml index bb51c4ff..fb535e8b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,8 +18,8 @@ resolver = "2" # The tag or rev of ndc-models must match the locked tag or rev of the # ndc-models dependency of ndc-sdk [workspace.dependencies] -ndc-sdk = { git = "https://github.com/hasura/ndc-sdk-rs.git" } -ndc-models = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.1.2" } +ndc-sdk = { git = "https://github.com/hasura/ndc-sdk-rs.git", tag = "v0.1.3" } +ndc-models = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.1.3" } indexmap = { version = "2", features = ["serde"] } # should match the version that ndc-models uses itertools = "^0.12.1" From 44a82d4e9b80575d328f8a7e294a07145a0990d7 Mon Sep 17 00:00:00 2001 From: David Overton Date: Thu, 6 Jun 2024 16:50:52 +1000 Subject: [PATCH 02/34] Fix build --- crates/configuration/src/schema/mod.rs | 1 + crates/mongodb-connector/src/capabilities.rs | 9 +++++++-- crates/mongodb-connector/src/mutation.rs | 2 +- .../ndc-query-plan/src/plan_for_query_request/mod.rs | 12 ++++++------ .../plan_for_query_request/type_annotated_field.rs | 2 +- crates/ndc-test-helpers/src/comparison_target.rs | 1 + crates/ndc-test-helpers/src/object_type.rs | 3 +++ 7 files changed, 20 insertions(+), 10 deletions(-) diff --git a/crates/configuration/src/schema/mod.rs b/crates/configuration/src/schema/mod.rs index f6524770..d69a658e 100644 --- a/crates/configuration/src/schema/mod.rs +++ b/crates/configuration/src/schema/mod.rs @@ -149,6 +149,7 @@ impl From for ndc_models::ObjectField { ndc_models::ObjectField { description: field.description, r#type: field.r#type.into(), + arguments: BTreeMap::new(), } } } diff --git a/crates/mongodb-connector/src/capabilities.rs b/crates/mongodb-connector/src/capabilities.rs index 3319e74e..733a2419 100644 --- a/crates/mongodb-connector/src/capabilities.rs +++ b/crates/mongodb-connector/src/capabilities.rs @@ -1,15 +1,20 @@ use ndc_sdk::models::{ - Capabilities, CapabilitiesResponse, LeafCapability, QueryCapabilities, RelationshipCapabilities, + Capabilities, CapabilitiesResponse, LeafCapability, NestedFieldCapabilities, QueryCapabilities, + RelationshipCapabilities, }; pub fn mongo_capabilities_response() -> CapabilitiesResponse { ndc_sdk::models::CapabilitiesResponse { - version: "0.1.2".to_owned(), + version: "0.1.3".to_owned(), capabilities: Capabilities { query: QueryCapabilities { aggregates: Some(LeafCapability {}), variables: Some(LeafCapability {}), explain: Some(LeafCapability {}), + nested_fields: NestedFieldCapabilities { + filter_by: Some(LeafCapability {}), + order_by: Some(LeafCapability {}), + }, }, mutation: ndc_sdk::models::MutationCapabilities { transactional: None, diff --git a/crates/mongodb-connector/src/mutation.rs b/crates/mongodb-connector/src/mutation.rs index 74a2bdbf..fca53143 100644 --- a/crates/mongodb-connector/src/mutation.rs +++ b/crates/mongodb-connector/src/mutation.rs @@ -145,7 +145,7 @@ fn rewrite_doc( .iter() .map(|(name, field)| { let field_value = match field { - ndc::Field::Column { column, fields } => { + ndc::Field::Column { column, fields, arguments: _ } => { let orig_value = doc.remove(column).ok_or_else(|| { MutationError::UnprocessableContent(format!( "missing expected field from response: {name}" diff --git a/crates/ndc-query-plan/src/plan_for_query_request/mod.rs b/crates/ndc-query-plan/src/plan_for_query_request/mod.rs index 883fa0ba..f0477f13 100644 --- a/crates/ndc-query-plan/src/plan_for_query_request/mod.rs +++ b/crates/ndc-query-plan/src/plan_for_query_request/mod.rs @@ -208,9 +208,9 @@ fn plan_for_order_by_element( element: ndc::OrderByElement, ) -> Result> { let target = match element.target { - ndc::OrderByTarget::Column { name, path } => plan::OrderByTarget::Column { + ndc::OrderByTarget::Column { name, field_path, path } => plan::OrderByTarget::Column { name: name.clone(), - field_path: Default::default(), // TODO: propagate this after ndc-spec update + field_path, path: plan_for_relationship_path( plan_state, root_collection_object_type, @@ -492,7 +492,7 @@ fn plan_for_comparison_target( target: ndc::ComparisonTarget, ) -> Result> { match target { - ndc::ComparisonTarget::Column { name, path } => { + ndc::ComparisonTarget::Column { name, field_path, path } => { let requested_columns = vec![name.clone()]; let (path, target_object_type) = plan_for_relationship_path( plan_state, @@ -504,16 +504,16 @@ fn plan_for_comparison_target( let column_type = find_object_field(&target_object_type, &name)?.clone(); Ok(plan::ComparisonTarget::Column { name, - field_path: Default::default(), // TODO: propagate this after ndc-spec update + field_path, path, column_type, }) } - ndc::ComparisonTarget::RootCollectionColumn { name } => { + ndc::ComparisonTarget::RootCollectionColumn { name, field_path } => { let column_type = find_object_field(root_collection_object_type, &name)?.clone(); Ok(plan::ComparisonTarget::RootCollectionColumn { name, - field_path: Default::default(), // TODO: propagate this after ndc-spec update + field_path, column_type, }) } diff --git a/crates/ndc-query-plan/src/plan_for_query_request/type_annotated_field.rs b/crates/ndc-query-plan/src/plan_for_query_request/type_annotated_field.rs index cd8b6a02..3fe82d9d 100644 --- a/crates/ndc-query-plan/src/plan_for_query_request/type_annotated_field.rs +++ b/crates/ndc-query-plan/src/plan_for_query_request/type_annotated_field.rs @@ -39,7 +39,7 @@ fn type_annotated_field_helper( path: &[&str], ) -> Result> { let field = match field { - ndc::Field::Column { column, fields } => { + ndc::Field::Column { column, fields, arguments: _ } => { let column_type = find_object_field(collection_object_type, &column)?; let fields = fields .map(|nested_field| { diff --git a/crates/ndc-test-helpers/src/comparison_target.rs b/crates/ndc-test-helpers/src/comparison_target.rs index 73586dd4..42fd6f3f 100644 --- a/crates/ndc-test-helpers/src/comparison_target.rs +++ b/crates/ndc-test-helpers/src/comparison_target.rs @@ -37,5 +37,6 @@ where { ndc_models::ComparisonTarget::RootCollectionColumn { name: name.to_string(), + field_path: None, } } diff --git a/crates/ndc-test-helpers/src/object_type.rs b/crates/ndc-test-helpers/src/object_type.rs index 9950abad..58758525 100644 --- a/crates/ndc-test-helpers/src/object_type.rs +++ b/crates/ndc-test-helpers/src/object_type.rs @@ -1,3 +1,5 @@ +use std::collections::BTreeMap; + use ndc_models::{ObjectField, ObjectType, Type}; pub fn object_type( @@ -12,6 +14,7 @@ pub fn object_type( name.to_string(), ObjectField { description: Default::default(), + arguments: BTreeMap::new(), r#type: field_type.into(), }, ) From 82c67266bc7956a6f438156ecc45c520f82ceb0c Mon Sep 17 00:00:00 2001 From: David Overton Date: Fri, 7 Jun 2024 11:44:19 +1000 Subject: [PATCH 03/34] Fix test build --- crates/ndc-query-plan/src/plan_for_query_request/tests.rs | 2 ++ crates/ndc-test-helpers/src/comparison_target.rs | 2 ++ crates/ndc-test-helpers/src/field.rs | 3 +++ 3 files changed, 7 insertions(+) diff --git a/crates/ndc-query-plan/src/plan_for_query_request/tests.rs b/crates/ndc-query-plan/src/plan_for_query_request/tests.rs index 69a46b51..614e4090 100644 --- a/crates/ndc-query-plan/src/plan_for_query_request/tests.rs +++ b/crates/ndc-query-plan/src/plan_for_query_request/tests.rs @@ -55,6 +55,7 @@ fn translates_query_request_relationships() -> Result<(), anyhow::Error> { order_direction: OrderDirection::Asc, target: OrderByTarget::Column { name: "advisor_name".to_owned(), + field_path: None, path: vec![ path_element("school_classes") .predicate(binop( @@ -575,6 +576,7 @@ fn translates_relationships_in_fields_predicates_and_orderings() -> Result<(), a order_direction: OrderDirection::Desc, target: OrderByTarget::Column { name: "id".into(), + field_path: None, path: vec![], }, }, diff --git a/crates/ndc-test-helpers/src/comparison_target.rs b/crates/ndc-test-helpers/src/comparison_target.rs index 42fd6f3f..b8f9533f 100644 --- a/crates/ndc-test-helpers/src/comparison_target.rs +++ b/crates/ndc-test-helpers/src/comparison_target.rs @@ -3,6 +3,7 @@ macro_rules! target { ($column:literal) => { $crate::ndc_models::ComparisonTarget::Column { name: $column.to_owned(), + field_path: None, path: vec![], } }; @@ -16,6 +17,7 @@ macro_rules! target { ($column:literal, relations:$path:expr $(,)?) => { $crate::ndc_models::ComparisonTarget::Column { name: $column.to_owned(), + field_path: None, path: $path.into_iter().map(|x| x.into()).collect(), } }; diff --git a/crates/ndc-test-helpers/src/field.rs b/crates/ndc-test-helpers/src/field.rs index c5987598..18cee830 100644 --- a/crates/ndc-test-helpers/src/field.rs +++ b/crates/ndc-test-helpers/src/field.rs @@ -5,6 +5,7 @@ macro_rules! field { $name, $crate::ndc_models::Field::Column { column: $name.to_owned(), + arguments: Default::default(), fields: None, }, ) @@ -14,6 +15,7 @@ macro_rules! field { $name, $crate::ndc_models::Field::Column { column: $column_name.to_owned(), + arguments: Default::default(), fields: None, }, ) @@ -23,6 +25,7 @@ macro_rules! field { $name, $crate::ndc_models::Field::Column { column: $column_name.to_owned(), + arguments: Default::default(), fields: Some($fields.into()), }, ) From a0cf93f8dd608ef92643f7eddadaf75e36bb0395 Mon Sep 17 00:00:00 2001 From: David Overton Date: Thu, 13 Jun 2024 22:16:48 +1000 Subject: [PATCH 04/34] Update to ndc v0.1.4 --- Cargo.lock | 12 ++++++------ Cargo.toml | 4 ++-- crates/mongodb-connector/src/capabilities.rs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 770dffbb..0ee63e0e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1690,8 +1690,8 @@ dependencies = [ [[package]] name = "ndc-models" -version = "0.1.3" -source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.1.3#b9316d206a6aece470531937f6e1ea9223e88122" +version = "0.1.4" +source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.1.4#20172e3b2552b78d16dbafcd047f559ced420309" dependencies = [ "indexmap 2.2.5", "schemars", @@ -1720,8 +1720,8 @@ dependencies = [ [[package]] name = "ndc-sdk" -version = "0.1.3" -source = "git+https://github.com/hasura/ndc-sdk-rs.git?tag=v0.1.3#266f4db31777d2a0885a665e0d982237503b223c" +version = "0.1.4" +source = "git+https://github.com/hasura/ndc-sdk-rs.git?tag=v0.1.4#29adcb5983c1237e8a5f4732d5230c2ba8ab75d3" dependencies = [ "async-trait", "axum", @@ -1753,8 +1753,8 @@ dependencies = [ [[package]] name = "ndc-test" -version = "0.1.3" -source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.1.3#b9316d206a6aece470531937f6e1ea9223e88122" +version = "0.1.4" +source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.1.4#20172e3b2552b78d16dbafcd047f559ced420309" dependencies = [ "async-trait", "clap", diff --git a/Cargo.toml b/Cargo.toml index fb535e8b..648b7991 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,8 +18,8 @@ resolver = "2" # The tag or rev of ndc-models must match the locked tag or rev of the # ndc-models dependency of ndc-sdk [workspace.dependencies] -ndc-sdk = { git = "https://github.com/hasura/ndc-sdk-rs.git", tag = "v0.1.3" } -ndc-models = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.1.3" } +ndc-sdk = { git = "https://github.com/hasura/ndc-sdk-rs.git", tag = "v0.1.4" } +ndc-models = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.1.4" } indexmap = { version = "2", features = ["serde"] } # should match the version that ndc-models uses itertools = "^0.12.1" diff --git a/crates/mongodb-connector/src/capabilities.rs b/crates/mongodb-connector/src/capabilities.rs index 733a2419..30d8bcde 100644 --- a/crates/mongodb-connector/src/capabilities.rs +++ b/crates/mongodb-connector/src/capabilities.rs @@ -5,7 +5,7 @@ use ndc_sdk::models::{ pub fn mongo_capabilities_response() -> CapabilitiesResponse { ndc_sdk::models::CapabilitiesResponse { - version: "0.1.3".to_owned(), + version: "0.1.4".to_owned(), capabilities: Capabilities { query: QueryCapabilities { aggregates: Some(LeafCapability {}), From d6039a59d870bd03b9a2b875c6395b2af7b4ca0d Mon Sep 17 00:00:00 2001 From: David Overton Date: Thu, 13 Jun 2024 22:20:02 +1000 Subject: [PATCH 05/34] Fix build --- crates/cli/src/introspection/mod.rs | 1 - crates/cli/src/introspection/sampling.rs | 36 ++++++++++++++----- crates/cli/src/lib.rs | 17 ++++++--- .../mongodb-agent-common/src/mongodb/mod.rs | 8 ++--- crates/mongodb-connector/src/capabilities.rs | 1 + crates/mongodb-connector/src/mutation.rs | 6 +++- crates/mongodb-support/src/align.rs | 8 ++++- .../src/plan_for_query_request/mod.rs | 27 ++++++++++---- .../type_annotated_field.rs | 6 +++- crates/ndc-test-helpers/src/aggregates.rs | 7 ++-- 10 files changed, 83 insertions(+), 34 deletions(-) diff --git a/crates/cli/src/introspection/mod.rs b/crates/cli/src/introspection/mod.rs index e1fb76d6..b84e8327 100644 --- a/crates/cli/src/introspection/mod.rs +++ b/crates/cli/src/introspection/mod.rs @@ -4,4 +4,3 @@ pub mod validation_schema; pub use sampling::{sample_schema_from_db, type_from_bson}; pub use validation_schema::get_metadata_from_validation_schema; - diff --git a/crates/cli/src/introspection/sampling.rs b/crates/cli/src/introspection/sampling.rs index 51dc41f9..877cccae 100644 --- a/crates/cli/src/introspection/sampling.rs +++ b/crates/cli/src/introspection/sampling.rs @@ -31,8 +31,13 @@ pub async fn sample_schema_from_db( while let Some(collection_spec) = collections_cursor.try_next().await? { let collection_name = collection_spec.name; if !existing_schemas.contains(&collection_name) || config_file_changed { - let collection_schema = - sample_schema_from_collection(&collection_name, sample_size, all_schema_nullalble, state).await?; + let collection_schema = sample_schema_from_collection( + &collection_name, + sample_size, + all_schema_nullalble, + state, + ) + .await?; schemas.insert(collection_name, collection_schema); } } @@ -74,7 +79,11 @@ async fn sample_schema_from_collection( }) } -fn make_object_type(object_type_name: &str, document: &Document, all_schema_nullalble: bool) -> Vec { +fn make_object_type( + object_type_name: &str, + document: &Document, + all_schema_nullalble: bool, +) -> Vec { let (mut object_type_defs, object_fields) = { let type_prefix = format!("{object_type_name}_"); let (object_type_defs, object_fields): (Vec>, Vec) = document @@ -105,7 +114,8 @@ fn make_object_field( all_schema_nullalble: bool, ) -> (Vec, ObjectField) { let object_type_name = format!("{type_prefix}{field_name}"); - let (collected_otds, field_type) = make_field_type(&object_type_name, field_value, all_schema_nullalble); + let (collected_otds, field_type) = + make_field_type(&object_type_name, field_value, all_schema_nullalble); let object_field_value = WithName::named( field_name.to_owned(), schema::ObjectField { @@ -132,7 +142,11 @@ pub fn type_from_bson( (WithName::into_map(object_types), t) } -fn make_field_type(object_type_name: &str, field_value: &Bson, all_schema_nullalble: bool) -> (Vec, Type) { +fn make_field_type( + object_type_name: &str, + field_value: &Bson, + all_schema_nullalble: bool, +) -> (Vec, Type) { fn scalar(t: BsonScalarType) -> (Vec, Type) { (vec![], Type::Scalar(t)) } @@ -144,7 +158,8 @@ fn make_field_type(object_type_name: &str, field_value: &Bson, all_schema_nullal let mut collected_otds = vec![]; let mut result_type = Type::Scalar(Undefined); for elem in arr { - let (elem_collected_otds, elem_type) = make_field_type(object_type_name, elem, all_schema_nullalble); + let (elem_collected_otds, elem_type) = + make_field_type(object_type_name, elem, all_schema_nullalble); collected_otds = if collected_otds.is_empty() { elem_collected_otds } else { @@ -195,7 +210,8 @@ mod tests { fn simple_doc() -> Result<(), anyhow::Error> { let object_name = "foo"; let doc = doc! {"my_int": 1, "my_string": "two"}; - let result = WithName::into_map::>(make_object_type(object_name, &doc, false)); + let result = + WithName::into_map::>(make_object_type(object_name, &doc, false)); let expected = BTreeMap::from([( object_name.to_owned(), @@ -229,7 +245,8 @@ mod tests { fn array_of_objects() -> Result<(), anyhow::Error> { let object_name = "foo"; let doc = doc! {"my_array": [{"foo": 42, "bar": ""}, {"bar": "wut", "baz": 3.77}]}; - let result = WithName::into_map::>(make_object_type(object_name, &doc, false)); + let result = + WithName::into_map::>(make_object_type(object_name, &doc, false)); let expected = BTreeMap::from([ ( @@ -289,7 +306,8 @@ mod tests { fn non_unifiable_array_of_objects() -> Result<(), anyhow::Error> { let object_name = "foo"; let doc = doc! {"my_array": [{"foo": 42, "bar": ""}, {"bar": 17, "baz": 3.77}]}; - let result = WithName::into_map::>(make_object_type(object_name, &doc, false)); + let result = + WithName::into_map::>(make_object_type(object_name, &doc, false)); let expected = BTreeMap::from([ ( diff --git a/crates/cli/src/lib.rs b/crates/cli/src/lib.rs index f171e515..7afa0b3f 100644 --- a/crates/cli/src/lib.rs +++ b/crates/cli/src/lib.rs @@ -44,19 +44,28 @@ pub async fn run(command: Command, context: &Context) -> anyhow::Result<()> { /// Update the configuration in the current directory by introspecting the database. async fn update(context: &Context, args: &UpdateArgs) -> anyhow::Result<()> { - let configuration_options = configuration::parse_configuration_options_file(&context.path).await; + let configuration_options = + configuration::parse_configuration_options_file(&context.path).await; // Prefer arguments passed to cli, and fallback to the configuration file let sample_size = match args.sample_size { Some(size) => size, - None => configuration_options.introspection_options.sample_size + None => configuration_options.introspection_options.sample_size, }; let no_validator_schema = match args.no_validator_schema { Some(validator) => validator, - None => configuration_options.introspection_options.no_validator_schema + None => { + configuration_options + .introspection_options + .no_validator_schema + } }; let all_schema_nullable = match args.all_schema_nullable { Some(validator) => validator, - None => configuration_options.introspection_options.all_schema_nullable + None => { + configuration_options + .introspection_options + .all_schema_nullable + } }; let config_file_changed = configuration::get_config_file_changed(&context.path).await?; diff --git a/crates/mongodb-agent-common/src/mongodb/mod.rs b/crates/mongodb-agent-common/src/mongodb/mod.rs index f311835e..8931d5db 100644 --- a/crates/mongodb-agent-common/src/mongodb/mod.rs +++ b/crates/mongodb-agent-common/src/mongodb/mod.rs @@ -10,12 +10,8 @@ mod stage; pub mod test_helpers; pub use self::{ - accumulator::Accumulator, - collection::CollectionTrait, - database::DatabaseTrait, - pipeline::Pipeline, - selection::Selection, - stage::Stage, + accumulator::Accumulator, collection::CollectionTrait, database::DatabaseTrait, + pipeline::Pipeline, selection::Selection, stage::Stage, }; // MockCollectionTrait is generated by automock when the test flag is active. diff --git a/crates/mongodb-connector/src/capabilities.rs b/crates/mongodb-connector/src/capabilities.rs index 30d8bcde..1129bb8a 100644 --- a/crates/mongodb-connector/src/capabilities.rs +++ b/crates/mongodb-connector/src/capabilities.rs @@ -14,6 +14,7 @@ pub fn mongo_capabilities_response() -> CapabilitiesResponse { nested_fields: NestedFieldCapabilities { filter_by: Some(LeafCapability {}), order_by: Some(LeafCapability {}), + aggregates: None, }, }, mutation: ndc_sdk::models::MutationCapabilities { diff --git a/crates/mongodb-connector/src/mutation.rs b/crates/mongodb-connector/src/mutation.rs index fca53143..2b79d51d 100644 --- a/crates/mongodb-connector/src/mutation.rs +++ b/crates/mongodb-connector/src/mutation.rs @@ -145,7 +145,11 @@ fn rewrite_doc( .iter() .map(|(name, field)| { let field_value = match field { - ndc::Field::Column { column, fields, arguments: _ } => { + ndc::Field::Column { + column, + fields, + arguments: _, + } => { let orig_value = doc.remove(column).ok_or_else(|| { MutationError::UnprocessableContent(format!( "missing expected field from response: {name}" diff --git a/crates/mongodb-support/src/align.rs b/crates/mongodb-support/src/align.rs index 02de15cb..89ecf741 100644 --- a/crates/mongodb-support/src/align.rs +++ b/crates/mongodb-support/src/align.rs @@ -1,7 +1,13 @@ use indexmap::IndexMap; use std::hash::Hash; -pub fn align(ts: IndexMap, mut us: IndexMap, ft: FT, fu: FU, ftu: FTU) -> IndexMap +pub fn align( + ts: IndexMap, + mut us: IndexMap, + ft: FT, + fu: FU, + ftu: FTU, +) -> IndexMap where K: Hash + Eq, FT: Fn(T) -> V, diff --git a/crates/ndc-query-plan/src/plan_for_query_request/mod.rs b/crates/ndc-query-plan/src/plan_for_query_request/mod.rs index f0477f13..eb8ba865 100644 --- a/crates/ndc-query-plan/src/plan_for_query_request/mod.rs +++ b/crates/ndc-query-plan/src/plan_for_query_request/mod.rs @@ -134,10 +134,16 @@ fn plan_for_aggregate( aggregate: ndc::Aggregate, ) -> Result> { match aggregate { - ndc::Aggregate::ColumnCount { column, distinct } => { - Ok(plan::Aggregate::ColumnCount { column, distinct }) - } - ndc::Aggregate::SingleColumn { column, function } => { + ndc::Aggregate::ColumnCount { + column, + distinct, + field_path: _, + } => Ok(plan::Aggregate::ColumnCount { column, distinct }), + ndc::Aggregate::SingleColumn { + column, + function, + field_path: _, + } => { let object_type_field_type = find_object_field(collection_object_type, column.as_ref())?; // let column_scalar_type_name = get_scalar_type_name(&object_type_field.r#type)?; @@ -208,7 +214,11 @@ fn plan_for_order_by_element( element: ndc::OrderByElement, ) -> Result> { let target = match element.target { - ndc::OrderByTarget::Column { name, field_path, path } => plan::OrderByTarget::Column { + ndc::OrderByTarget::Column { + name, + field_path, + path, + } => plan::OrderByTarget::Column { name: name.clone(), field_path, path: plan_for_relationship_path( @@ -224,6 +234,7 @@ fn plan_for_order_by_element( column, function, path, + field_path: _, } => { let (plan_path, target_object_type) = plan_for_relationship_path( plan_state, @@ -492,7 +503,11 @@ fn plan_for_comparison_target( target: ndc::ComparisonTarget, ) -> Result> { match target { - ndc::ComparisonTarget::Column { name, field_path, path } => { + ndc::ComparisonTarget::Column { + name, + field_path, + path, + } => { let requested_columns = vec![name.clone()]; let (path, target_object_type) = plan_for_relationship_path( plan_state, diff --git a/crates/ndc-query-plan/src/plan_for_query_request/type_annotated_field.rs b/crates/ndc-query-plan/src/plan_for_query_request/type_annotated_field.rs index 3fe82d9d..7aa63e4b 100644 --- a/crates/ndc-query-plan/src/plan_for_query_request/type_annotated_field.rs +++ b/crates/ndc-query-plan/src/plan_for_query_request/type_annotated_field.rs @@ -39,7 +39,11 @@ fn type_annotated_field_helper( path: &[&str], ) -> Result> { let field = match field { - ndc::Field::Column { column, fields, arguments: _ } => { + ndc::Field::Column { + column, + fields, + arguments: _, + } => { let column_type = find_object_field(collection_object_type, &column)?; let fields = fields .map(|nested_field| { diff --git a/crates/ndc-test-helpers/src/aggregates.rs b/crates/ndc-test-helpers/src/aggregates.rs index bfa83d41..29250645 100644 --- a/crates/ndc-test-helpers/src/aggregates.rs +++ b/crates/ndc-test-helpers/src/aggregates.rs @@ -5,7 +5,7 @@ macro_rules! column_aggregate { $name, $crate::ndc_models::Aggregate::SingleColumn { column: $column.to_owned(), - function: $function.to_owned() + function: $function.to_owned(), }, ) }; @@ -14,10 +14,7 @@ macro_rules! column_aggregate { #[macro_export()] macro_rules! star_count_aggregate { ($name:literal) => { - ( - $name, - $crate::ndc_models::Aggregate::StarCount {}, - ) + ($name, $crate::ndc_models::Aggregate::StarCount {}) }; } From af93888c6674afb14bc55e179284cffc99f38852 Mon Sep 17 00:00:00 2001 From: David Overton Date: Thu, 13 Jun 2024 22:22:04 +1000 Subject: [PATCH 06/34] Fix tests --- crates/ndc-query-plan/src/plan_for_query_request/tests.rs | 1 + crates/ndc-test-helpers/src/aggregates.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/crates/ndc-query-plan/src/plan_for_query_request/tests.rs b/crates/ndc-query-plan/src/plan_for_query_request/tests.rs index 614e4090..56b5f1a3 100644 --- a/crates/ndc-query-plan/src/plan_for_query_request/tests.rs +++ b/crates/ndc-query-plan/src/plan_for_query_request/tests.rs @@ -570,6 +570,7 @@ fn translates_relationships_in_fields_predicates_and_orderings() -> Result<(), a column: "year".into(), function: "Average".into(), path: vec![path_element("author_articles").into()], + field_path: None, }, }, ndc::OrderByElement { diff --git a/crates/ndc-test-helpers/src/aggregates.rs b/crates/ndc-test-helpers/src/aggregates.rs index 29250645..6579273d 100644 --- a/crates/ndc-test-helpers/src/aggregates.rs +++ b/crates/ndc-test-helpers/src/aggregates.rs @@ -6,6 +6,7 @@ macro_rules! column_aggregate { $crate::ndc_models::Aggregate::SingleColumn { column: $column.to_owned(), function: $function.to_owned(), + field_path: None, }, ) }; @@ -26,6 +27,7 @@ macro_rules! column_count_aggregate { $crate::ndc_models::Aggregate::ColumnCount { column: $column.to_owned(), distinct: $distinct.to_owned(), + field_path: None, }, ) }; From c34dca0ea9dfc183b9b3f52a3825c7e4a64271e0 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Thu, 13 Jun 2024 12:55:45 -0700 Subject: [PATCH 07/34] generate supergraph --- .gitattributes | 1 + .../hasura/.devcontainer/devcontainer.json | 17 +++++++ fixtures/hasura/.env.engine | 6 +++ fixtures/hasura/.vscode/extensions.json | 5 +++ fixtures/hasura/.vscode/launch.json | 13 ++++++ fixtures/hasura/.vscode/tasks.json | 26 +++++++++++ fixtures/hasura/docker-compose.hasura.yaml | 45 +++++++++++++++++++ fixtures/hasura/engine/auth_config.json | 1 + fixtures/hasura/engine/metadata.json | 1 + fixtures/hasura/engine/open_dd.json | 1 + fixtures/hasura/hasura.yaml | 1 + fixtures/hasura/otel-collector-config.yaml | 35 +++++++++++++++ fixtures/hasura/supergraph.yaml | 11 +++++ .../.env.supergraph_globals | 0 .../hasura/supergraph_globals/auth-config.hml | 8 ++++ .../compatibility-config.hml | 2 + .../supergraph_globals/graphql-config.hml | 30 +++++++++++++ 17 files changed, 203 insertions(+) create mode 100644 .gitattributes create mode 100644 fixtures/hasura/.devcontainer/devcontainer.json create mode 100644 fixtures/hasura/.env.engine create mode 100644 fixtures/hasura/.vscode/extensions.json create mode 100644 fixtures/hasura/.vscode/launch.json create mode 100644 fixtures/hasura/.vscode/tasks.json create mode 100644 fixtures/hasura/docker-compose.hasura.yaml create mode 100644 fixtures/hasura/engine/auth_config.json create mode 100644 fixtures/hasura/engine/metadata.json create mode 100644 fixtures/hasura/engine/open_dd.json create mode 100644 fixtures/hasura/hasura.yaml create mode 100644 fixtures/hasura/otel-collector-config.yaml create mode 100644 fixtures/hasura/supergraph.yaml create mode 100644 fixtures/hasura/supergraph_globals/.env.supergraph_globals create mode 100644 fixtures/hasura/supergraph_globals/auth-config.hml create mode 100644 fixtures/hasura/supergraph_globals/compatibility-config.hml create mode 100644 fixtures/hasura/supergraph_globals/graphql-config.hml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..8ddc99f4 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.hml linguist-language=yaml \ No newline at end of file diff --git a/fixtures/hasura/.devcontainer/devcontainer.json b/fixtures/hasura/.devcontainer/devcontainer.json new file mode 100644 index 00000000..c73d191d --- /dev/null +++ b/fixtures/hasura/.devcontainer/devcontainer.json @@ -0,0 +1,17 @@ +{ + "customizations": { + "vscode": { + "extensions": [ + "HasuraHQ.hasura" + ], + "settings": { + "terminal.integrated.shell.linux": "/bin/bash", + "terminal.integrated.shellArgs.linux": [ + "-l" + ] + } + } + }, + "name": "Hasura DDN Codespace", + "postCreateCommand": "curl -L https://graphql-engine-cdn.hasura.io/ddn/cli/v1/get.sh | bash" +} diff --git a/fixtures/hasura/.env.engine b/fixtures/hasura/.env.engine new file mode 100644 index 00000000..42ca016a --- /dev/null +++ b/fixtures/hasura/.env.engine @@ -0,0 +1,6 @@ +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 +CORS_ALLOW_ORIGIN=https://console.arusah.com diff --git a/fixtures/hasura/.vscode/extensions.json b/fixtures/hasura/.vscode/extensions.json new file mode 100644 index 00000000..18cf1245 --- /dev/null +++ b/fixtures/hasura/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "HasuraHQ.hasura" + ] +} diff --git a/fixtures/hasura/.vscode/launch.json b/fixtures/hasura/.vscode/launch.json new file mode 100644 index 00000000..3d7bb31d --- /dev/null +++ b/fixtures/hasura/.vscode/launch.json @@ -0,0 +1,13 @@ +{ + "configurations": [ + { + "cwd": "${workspaceFolder}", + "name": "DDN Dev", + "preLaunchTask": "dev", + "program": "${workspaceFolder}", + "request": "launch", + "type": "node" + } + ], + "version": "0.2.0" +} diff --git a/fixtures/hasura/.vscode/tasks.json b/fixtures/hasura/.vscode/tasks.json new file mode 100644 index 00000000..fd278591 --- /dev/null +++ b/fixtures/hasura/.vscode/tasks.json @@ -0,0 +1,26 @@ +{ + "tasks": [ + { + "args": [ + "watch", + "--dir", + "." + ], + "command": "ddn", + "label": "watch", + "options": { + "cwd": "${workspaceFolder}" + }, + "presentation": { + "clear": true, + "close": false, + "focus": true, + "panel": "new", + "reveal": "always" + }, + "problemMatcher": [], + "type": "shell" + } + ], + "version": "2.0.0" +} diff --git a/fixtures/hasura/docker-compose.hasura.yaml b/fixtures/hasura/docker-compose.hasura.yaml new file mode 100644 index 00000000..385f5a7d --- /dev/null +++ b/fixtures/hasura/docker-compose.hasura.yaml @@ -0,0 +1,45 @@ +services: + auth_hook: + image: ghcr.io/hasura/v3-dev-auth-webhook + engine: + build: + context: engine + dockerfile_inline: |- + FROM ghcr.io/hasura/v3-engine + COPY ./ /md/ + develop: + watch: + - path: engine + action: sync+restart + target: /md/ + depends_on: + auth_hook: + condition: service_started + required: false + env_file: + - .env.engine + extra_hosts: + - local.hasura.dev=host-gateway + platform: linux/amd64 + ports: + - mode: ingress + target: 3000 + published: "3000" + protocol: tcp + otel-collector: + command: + - --config=/etc/otel-collector-config.yaml + environment: + HASURA_DDN_PAT: ${HASURA_DDN_PAT} + image: otel/opentelemetry-collector + ports: + - mode: ingress + target: 4317 + published: "4317" + protocol: tcp + - mode: ingress + target: 4318 + published: "4318" + protocol: tcp + volumes: + - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml diff --git a/fixtures/hasura/engine/auth_config.json b/fixtures/hasura/engine/auth_config.json new file mode 100644 index 00000000..8a73e5b4 --- /dev/null +++ b/fixtures/hasura/engine/auth_config.json @@ -0,0 +1 @@ +{"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 new file mode 100644 index 00000000..9760c278 --- /dev/null +++ b/fixtures/hasura/engine/metadata.json @@ -0,0 +1 @@ +{"subgraphs":[],"supergraph":{"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-06-13","kind":"CompatibilityConfig"}]},"version":"v1"} \ No newline at end of file diff --git a/fixtures/hasura/engine/open_dd.json b/fixtures/hasura/engine/open_dd.json new file mode 100644 index 00000000..93764643 --- /dev/null +++ b/fixtures/hasura/engine/open_dd.json @@ -0,0 +1 @@ +{"version":"v2","supergraph":{"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}}]},"subgraphs":[],"flags":{"require_graphql_config":false}} \ No newline at end of file diff --git a/fixtures/hasura/hasura.yaml b/fixtures/hasura/hasura.yaml new file mode 100644 index 00000000..b4d4e478 --- /dev/null +++ b/fixtures/hasura/hasura.yaml @@ -0,0 +1 @@ +version: v2 diff --git a/fixtures/hasura/otel-collector-config.yaml b/fixtures/hasura/otel-collector-config.yaml new file mode 100644 index 00000000..c2955fc5 --- /dev/null +++ b/fixtures/hasura/otel-collector-config.yaml @@ -0,0 +1,35 @@ +exporters: + otlp: + endpoint: https://gateway.otlp.arusah.com:443 + headers: + Authorization: pat ${env:HASURA_DDN_PAT} +processors: + batch: {} +receivers: + otlp: + protocols: + grpc: {} + http: {} +service: + pipelines: + logs: + exporters: + - otlp + processors: + - batch + receivers: + - otlp + metrics: + exporters: + - otlp + processors: + - batch + receivers: + - otlp + traces: + exporters: + - otlp + processors: + - batch + receivers: + - otlp diff --git a/fixtures/hasura/supergraph.yaml b/fixtures/hasura/supergraph.yaml new file mode 100644 index 00000000..802c5270 --- /dev/null +++ b/fixtures/hasura/supergraph.yaml @@ -0,0 +1,11 @@ +kind: Supergraph +version: v1 +definition: + supergraph_globals: + generator: + rootPath: ./supergraph_globals + envFile: ./supergraph_globals/.env.supergraph_globals + includePaths: + - ./supergraph_globals/auth-config.hml + - ./supergraph_globals/compatibility-config.hml + - ./supergraph_globals/graphql-config.hml diff --git a/fixtures/hasura/supergraph_globals/.env.supergraph_globals b/fixtures/hasura/supergraph_globals/.env.supergraph_globals new file mode 100644 index 00000000..e69de29b diff --git a/fixtures/hasura/supergraph_globals/auth-config.hml b/fixtures/hasura/supergraph_globals/auth-config.hml new file mode 100644 index 00000000..367e5064 --- /dev/null +++ b/fixtures/hasura/supergraph_globals/auth-config.hml @@ -0,0 +1,8 @@ +kind: AuthConfig +version: v1 +definition: + allowRoleEmulationBy: admin + mode: + webhook: + url: http://auth_hook:3050/validate-request + method: Post diff --git a/fixtures/hasura/supergraph_globals/compatibility-config.hml b/fixtures/hasura/supergraph_globals/compatibility-config.hml new file mode 100644 index 00000000..4964e455 --- /dev/null +++ b/fixtures/hasura/supergraph_globals/compatibility-config.hml @@ -0,0 +1,2 @@ +kind: CompatibilityConfig +date: "2024-06-13" diff --git a/fixtures/hasura/supergraph_globals/graphql-config.hml b/fixtures/hasura/supergraph_globals/graphql-config.hml new file mode 100644 index 00000000..d5b9d9f6 --- /dev/null +++ b/fixtures/hasura/supergraph_globals/graphql-config.hml @@ -0,0 +1,30 @@ +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 + mutation: + rootOperationTypeName: Mutation From 3d379cfc05b3d87ac7e9ad187a90c2d74cd7d91f Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Thu, 13 Jun 2024 13:00:41 -0700 Subject: [PATCH 08/34] set supergraph context --- fixtures/hasura/.hasura/context.yaml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 fixtures/hasura/.hasura/context.yaml diff --git a/fixtures/hasura/.hasura/context.yaml b/fixtures/hasura/.hasura/context.yaml new file mode 100644 index 00000000..b23b1ec5 --- /dev/null +++ b/fixtures/hasura/.hasura/context.yaml @@ -0,0 +1,2 @@ +context: + supergraph: ../supergraph.yaml From a6395744957385c85c0a75c3625c62266b0eb45c Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Thu, 13 Jun 2024 13:11:34 -0700 Subject: [PATCH 09/34] set up subgraphs and connectors --- arion-compose/services/engine.nix | 1 + fixtures/hasura/chinook/.env.chinook | 0 .../chinook/connector/chinook/.ddnignore | 0 .../chinook/connector/chinook/.env.local | 3 +++ .../.hasura-connector/connector-metadata.yaml | 15 +++++++++++++ .../chinook/connector/chinook/connector.yaml | 8 +++++++ .../chinook/docker-compose.chinook.yaml | 21 +++++++++++++++++++ .../hasura/sample_mflix/.env.sample_mflix | 0 .../connector/sample_mflix/.ddnignore | 0 .../connector/sample_mflix/.env.local | 3 +++ .../.hasura-connector/connector-metadata.yaml | 15 +++++++++++++ .../connector/sample_mflix/connector.yaml | 8 +++++++ .../docker-compose.sample_mflix.yaml | 21 +++++++++++++++++++ fixtures/hasura/supergraph.yaml | 13 ++++++++++++ 14 files changed, 108 insertions(+) create mode 100644 fixtures/hasura/chinook/.env.chinook create mode 100644 fixtures/hasura/chinook/connector/chinook/.ddnignore create mode 100644 fixtures/hasura/chinook/connector/chinook/.env.local create mode 100644 fixtures/hasura/chinook/connector/chinook/.hasura-connector/connector-metadata.yaml create mode 100644 fixtures/hasura/chinook/connector/chinook/connector.yaml create mode 100644 fixtures/hasura/chinook/connector/chinook/docker-compose.chinook.yaml create mode 100644 fixtures/hasura/sample_mflix/.env.sample_mflix create mode 100644 fixtures/hasura/sample_mflix/connector/sample_mflix/.ddnignore create mode 100644 fixtures/hasura/sample_mflix/connector/sample_mflix/.env.local create mode 100644 fixtures/hasura/sample_mflix/connector/sample_mflix/.hasura-connector/connector-metadata.yaml create mode 100644 fixtures/hasura/sample_mflix/connector/sample_mflix/connector.yaml create mode 100644 fixtures/hasura/sample_mflix/connector/sample_mflix/docker-compose.sample_mflix.yaml diff --git a/arion-compose/services/engine.nix b/arion-compose/services/engine.nix index 6375a742..d39f5f9e 100644 --- a/arion-compose/services/engine.nix +++ b/arion-compose/services/engine.nix @@ -65,6 +65,7 @@ let auth-config = pkgs.writeText "auth_config.json" (builtins.toJSON { version = "v1"; definition = { + allowRoleEmulationBy = "admin"; mode.webhook = { url = auth-webhook.url; method = "Post"; diff --git a/fixtures/hasura/chinook/.env.chinook b/fixtures/hasura/chinook/.env.chinook new file mode 100644 index 00000000..e69de29b diff --git a/fixtures/hasura/chinook/connector/chinook/.ddnignore b/fixtures/hasura/chinook/connector/chinook/.ddnignore new file mode 100644 index 00000000..e69de29b diff --git a/fixtures/hasura/chinook/connector/chinook/.env.local b/fixtures/hasura/chinook/connector/chinook/.env.local new file mode 100644 index 00000000..6b2f63a9 --- /dev/null +++ b/fixtures/hasura/chinook/connector/chinook/.env.local @@ -0,0 +1,3 @@ +OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://local.hasura.dev:4317 +OTEL_SERVICE_NAME=chinook_chinook +MONGODB_DATABASE_URI="mongodb://mongodb/chinook" diff --git a/fixtures/hasura/chinook/connector/chinook/.hasura-connector/connector-metadata.yaml b/fixtures/hasura/chinook/connector/chinook/.hasura-connector/connector-metadata.yaml new file mode 100644 index 00000000..1e8bb916 --- /dev/null +++ b/fixtures/hasura/chinook/connector/chinook/.hasura-connector/connector-metadata.yaml @@ -0,0 +1,15 @@ +packagingDefinition: + type: PrebuiltDockerImage + dockerImage: ghcr.io/hasura/ndc-mongodb:v0.0.6 +supportedEnvironmentVariables: + - name: MONGODB_DATABASE_URI + description: The URI for the MongoDB database +commands: + update: hasura-ndc-mongodb update +cliPlugin: + name: ndc-mongodb + version: v0.0.6 +dockerComposeWatch: + - path: ./ + target: /etc/connector + action: sync+restart diff --git a/fixtures/hasura/chinook/connector/chinook/connector.yaml b/fixtures/hasura/chinook/connector/chinook/connector.yaml new file mode 100644 index 00000000..c41e013a --- /dev/null +++ b/fixtures/hasura/chinook/connector/chinook/connector.yaml @@ -0,0 +1,8 @@ +kind: Connector +version: v1 +definition: + name: chinook + subgraph: chinook + source: hasura/mongodb:v0.0.6 + context: . + envFile: .env.local diff --git a/fixtures/hasura/chinook/connector/chinook/docker-compose.chinook.yaml b/fixtures/hasura/chinook/connector/chinook/docker-compose.chinook.yaml new file mode 100644 index 00000000..dd449731 --- /dev/null +++ b/fixtures/hasura/chinook/connector/chinook/docker-compose.chinook.yaml @@ -0,0 +1,21 @@ +services: + chinook_chinook: + build: + context: . + dockerfile_inline: |- + FROM ghcr.io/hasura/ndc-mongodb:v0.0.6 + COPY ./ /etc/connector + develop: + watch: + - path: ./ + action: sync+restart + target: /etc/connector + env_file: + - .env.local + extra_hosts: + - local.hasura.dev=host-gateway + ports: + - mode: ingress + target: 8080 + published: "8081" + protocol: tcp diff --git a/fixtures/hasura/sample_mflix/.env.sample_mflix b/fixtures/hasura/sample_mflix/.env.sample_mflix new file mode 100644 index 00000000..e69de29b diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/.ddnignore b/fixtures/hasura/sample_mflix/connector/sample_mflix/.ddnignore new file mode 100644 index 00000000..e69de29b diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/.env.local b/fixtures/hasura/sample_mflix/connector/sample_mflix/.env.local new file mode 100644 index 00000000..77f5df48 --- /dev/null +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/.env.local @@ -0,0 +1,3 @@ +OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://local.hasura.dev:4317 +OTEL_SERVICE_NAME=sample_mflix_sample_mflix +MONGODB_DATABASE_URI="mongodb://mongodb/sample_mflix" diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/.hasura-connector/connector-metadata.yaml b/fixtures/hasura/sample_mflix/connector/sample_mflix/.hasura-connector/connector-metadata.yaml new file mode 100644 index 00000000..1e8bb916 --- /dev/null +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/.hasura-connector/connector-metadata.yaml @@ -0,0 +1,15 @@ +packagingDefinition: + type: PrebuiltDockerImage + dockerImage: ghcr.io/hasura/ndc-mongodb:v0.0.6 +supportedEnvironmentVariables: + - name: MONGODB_DATABASE_URI + description: The URI for the MongoDB database +commands: + update: hasura-ndc-mongodb update +cliPlugin: + name: ndc-mongodb + version: v0.0.6 +dockerComposeWatch: + - path: ./ + target: /etc/connector + action: sync+restart diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/connector.yaml b/fixtures/hasura/sample_mflix/connector/sample_mflix/connector.yaml new file mode 100644 index 00000000..59076a56 --- /dev/null +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/connector.yaml @@ -0,0 +1,8 @@ +kind: Connector +version: v1 +definition: + name: sample_mflix + subgraph: sample_mflix + source: hasura/mongodb:v0.0.6 + context: . + envFile: .env.local diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/docker-compose.sample_mflix.yaml b/fixtures/hasura/sample_mflix/connector/sample_mflix/docker-compose.sample_mflix.yaml new file mode 100644 index 00000000..40c45c13 --- /dev/null +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/docker-compose.sample_mflix.yaml @@ -0,0 +1,21 @@ +services: + sample_mflix_sample_mflix: + build: + context: . + dockerfile_inline: |- + FROM ghcr.io/hasura/ndc-mongodb:v0.0.6 + COPY ./ /etc/connector + develop: + watch: + - path: ./ + action: sync+restart + target: /etc/connector + env_file: + - .env.local + extra_hosts: + - local.hasura.dev=host-gateway + ports: + - mode: ingress + target: 8080 + published: "8081" + protocol: tcp diff --git a/fixtures/hasura/supergraph.yaml b/fixtures/hasura/supergraph.yaml index 802c5270..5b311c3f 100644 --- a/fixtures/hasura/supergraph.yaml +++ b/fixtures/hasura/supergraph.yaml @@ -9,3 +9,16 @@ definition: - ./supergraph_globals/auth-config.hml - ./supergraph_globals/compatibility-config.hml - ./supergraph_globals/graphql-config.hml + subgraphs: + chinook: + generator: + rootPath: chinook + envFile: chinook/.env.chinook + includePaths: + - chinook + sample_mflix: + generator: + rootPath: sample_mflix + envFile: sample_mflix/.env.sample_mflix + includePaths: + - sample_mflix From d8896bbc315679d42ea32ac32e405e8565e92b98 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Thu, 13 Jun 2024 14:28:49 -0700 Subject: [PATCH 10/34] introspect databases --- .../chinook/connector/chinook/.env.local | 2 +- .../sample_mflix/.configuration_metadata | 0 .../connector/sample_mflix/.env.local | 2 +- .../connector/sample_mflix/configuration.json | 7 + .../sample_mflix/schema/comments.json | 56 +++ .../connector/sample_mflix/schema/movies.json | 342 ++++++++++++++++++ .../sample_mflix/schema/sessions.json | 35 ++ .../sample_mflix/schema/theaters.json | 112 ++++++ .../connector/sample_mflix/schema/users.json | 52 +++ 9 files changed, 606 insertions(+), 2 deletions(-) create mode 100644 fixtures/hasura/sample_mflix/connector/sample_mflix/.configuration_metadata create mode 100644 fixtures/hasura/sample_mflix/connector/sample_mflix/configuration.json create mode 100644 fixtures/hasura/sample_mflix/connector/sample_mflix/schema/comments.json create mode 100644 fixtures/hasura/sample_mflix/connector/sample_mflix/schema/movies.json create mode 100644 fixtures/hasura/sample_mflix/connector/sample_mflix/schema/sessions.json create mode 100644 fixtures/hasura/sample_mflix/connector/sample_mflix/schema/theaters.json create mode 100644 fixtures/hasura/sample_mflix/connector/sample_mflix/schema/users.json diff --git a/fixtures/hasura/chinook/connector/chinook/.env.local b/fixtures/hasura/chinook/connector/chinook/.env.local index 6b2f63a9..7f6640d6 100644 --- a/fixtures/hasura/chinook/connector/chinook/.env.local +++ b/fixtures/hasura/chinook/connector/chinook/.env.local @@ -1,3 +1,3 @@ OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://local.hasura.dev:4317 OTEL_SERVICE_NAME=chinook_chinook -MONGODB_DATABASE_URI="mongodb://mongodb/chinook" +MONGODB_DATABASE_URI="mongodb://localhost/chinook" diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/.configuration_metadata b/fixtures/hasura/sample_mflix/connector/sample_mflix/.configuration_metadata new file mode 100644 index 00000000..e69de29b diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/.env.local b/fixtures/hasura/sample_mflix/connector/sample_mflix/.env.local index 77f5df48..884073bf 100644 --- a/fixtures/hasura/sample_mflix/connector/sample_mflix/.env.local +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/.env.local @@ -1,3 +1,3 @@ OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://local.hasura.dev:4317 OTEL_SERVICE_NAME=sample_mflix_sample_mflix -MONGODB_DATABASE_URI="mongodb://mongodb/sample_mflix" +MONGODB_DATABASE_URI="mongodb://localhost/sample_mflix" diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/configuration.json b/fixtures/hasura/sample_mflix/connector/sample_mflix/configuration.json new file mode 100644 index 00000000..3cb0a1c7 --- /dev/null +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/configuration.json @@ -0,0 +1,7 @@ +{ + "introspectionOptions": { + "sampleSize": 100, + "noValidatorSchema": false, + "allSchemaNullable": true + } +} \ No newline at end of file diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/comments.json b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/comments.json new file mode 100644 index 00000000..081e0eea --- /dev/null +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/comments.json @@ -0,0 +1,56 @@ +{ + "name": "comments", + "collections": { + "comments": { + "type": "comments" + } + }, + "objectTypes": { + "comments": { + "fields": { + "_id": { + "type": { + "nullable": { + "scalar": "objectId" + } + } + }, + "date": { + "type": { + "nullable": { + "scalar": "date" + } + } + }, + "email": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "movie_id": { + "type": { + "nullable": { + "scalar": "objectId" + } + } + }, + "name": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "text": { + "type": { + "nullable": { + "scalar": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/movies.json b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/movies.json new file mode 100644 index 00000000..9c46d6de --- /dev/null +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/movies.json @@ -0,0 +1,342 @@ +{ + "name": "movies", + "collections": { + "movies": { + "type": "movies" + } + }, + "objectTypes": { + "movies": { + "fields": { + "_id": { + "type": { + "nullable": { + "scalar": "objectId" + } + } + }, + "awards": { + "type": { + "nullable": { + "object": "movies_awards" + } + } + }, + "cast": { + "type": { + "nullable": { + "arrayOf": { + "scalar": "string" + } + } + } + }, + "countries": { + "type": { + "nullable": { + "arrayOf": { + "scalar": "string" + } + } + } + }, + "directors": { + "type": { + "nullable": { + "arrayOf": { + "scalar": "string" + } + } + } + }, + "fullplot": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "genres": { + "type": { + "nullable": { + "arrayOf": { + "scalar": "string" + } + } + } + }, + "imdb": { + "type": { + "nullable": { + "object": "movies_imdb" + } + } + }, + "languages": { + "type": { + "nullable": { + "arrayOf": { + "scalar": "string" + } + } + } + }, + "lastupdated": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "metacritic": { + "type": { + "nullable": { + "scalar": "int" + } + } + }, + "num_mflix_comments": { + "type": { + "nullable": { + "scalar": "int" + } + } + }, + "plot": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "poster": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "rated": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "released": { + "type": { + "nullable": { + "scalar": "date" + } + } + }, + "runtime": { + "type": { + "nullable": { + "scalar": "int" + } + } + }, + "title": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "tomatoes": { + "type": { + "nullable": { + "object": "movies_tomatoes" + } + } + }, + "type": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "writers": { + "type": { + "nullable": { + "arrayOf": { + "scalar": "string" + } + } + } + }, + "year": { + "type": { + "nullable": { + "scalar": "int" + } + } + } + } + }, + "movies_awards": { + "fields": { + "nominations": { + "type": { + "nullable": { + "scalar": "int" + } + } + }, + "text": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "wins": { + "type": { + "nullable": { + "scalar": "int" + } + } + } + } + }, + "movies_imdb": { + "fields": { + "id": { + "type": { + "nullable": { + "scalar": "int" + } + } + }, + "rating": { + "type": "extendedJSON" + }, + "votes": { + "type": { + "nullable": { + "scalar": "int" + } + } + } + } + }, + "movies_tomatoes": { + "fields": { + "boxOffice": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "consensus": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "critic": { + "type": { + "nullable": { + "object": "movies_tomatoes_critic" + } + } + }, + "dvd": { + "type": { + "nullable": { + "scalar": "date" + } + } + }, + "fresh": { + "type": { + "nullable": { + "scalar": "int" + } + } + }, + "lastUpdated": { + "type": { + "nullable": { + "scalar": "date" + } + } + }, + "production": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "rotten": { + "type": { + "nullable": { + "scalar": "int" + } + } + }, + "viewer": { + "type": { + "nullable": { + "object": "movies_tomatoes_viewer" + } + } + }, + "website": { + "type": { + "nullable": { + "scalar": "string" + } + } + } + } + }, + "movies_tomatoes_critic": { + "fields": { + "meter": { + "type": { + "nullable": { + "scalar": "int" + } + } + }, + "numReviews": { + "type": { + "nullable": { + "scalar": "int" + } + } + }, + "rating": { + "type": "extendedJSON" + } + } + }, + "movies_tomatoes_viewer": { + "fields": { + "meter": { + "type": { + "nullable": { + "scalar": "int" + } + } + }, + "numReviews": { + "type": { + "nullable": { + "scalar": "int" + } + } + }, + "rating": { + "type": "extendedJSON" + } + } + } + } +} \ No newline at end of file diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/sessions.json b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/sessions.json new file mode 100644 index 00000000..bbb5cd9f --- /dev/null +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/sessions.json @@ -0,0 +1,35 @@ +{ + "name": "sessions", + "collections": { + "sessions": { + "type": "sessions" + } + }, + "objectTypes": { + "sessions": { + "fields": { + "_id": { + "type": { + "nullable": { + "scalar": "objectId" + } + } + }, + "jwt": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "user_id": { + "type": { + "nullable": { + "scalar": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/theaters.json b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/theaters.json new file mode 100644 index 00000000..b19534c7 --- /dev/null +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/theaters.json @@ -0,0 +1,112 @@ +{ + "name": "theaters", + "collections": { + "theaters": { + "type": "theaters" + } + }, + "objectTypes": { + "theaters": { + "fields": { + "_id": { + "type": { + "nullable": { + "scalar": "objectId" + } + } + }, + "location": { + "type": { + "nullable": { + "object": "theaters_location" + } + } + }, + "theaterId": { + "type": { + "nullable": { + "scalar": "int" + } + } + } + } + }, + "theaters_location": { + "fields": { + "address": { + "type": { + "nullable": { + "object": "theaters_location_address" + } + } + }, + "geo": { + "type": { + "nullable": { + "object": "theaters_location_geo" + } + } + } + } + }, + "theaters_location_address": { + "fields": { + "city": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "state": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "street1": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "street2": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "zipcode": { + "type": { + "nullable": { + "scalar": "string" + } + } + } + } + }, + "theaters_location_geo": { + "fields": { + "coordinates": { + "type": { + "nullable": { + "arrayOf": { + "scalar": "double" + } + } + } + }, + "type": { + "type": { + "nullable": { + "scalar": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/users.json b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/users.json new file mode 100644 index 00000000..7d06e3f0 --- /dev/null +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/users.json @@ -0,0 +1,52 @@ +{ + "name": "users", + "collections": { + "users": { + "type": "users" + } + }, + "objectTypes": { + "users": { + "fields": { + "_id": { + "type": { + "nullable": { + "scalar": "objectId" + } + } + }, + "email": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "name": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "password": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "preferences": { + "type": { + "nullable": { + "object": "users_preferences" + } + } + } + } + }, + "users_preferences": { + "fields": {} + } + } +} \ No newline at end of file From 9e4912982d06ec1e93a8e2bc91346abbc30a84e7 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Thu, 13 Jun 2024 14:36:20 -0700 Subject: [PATCH 11/34] copy over sample_mflix config --- .../connector/sample_mflix/configuration.json | 4 +- .../sample_mflix/native_queries/hello.json | 0 .../native_queries/title_word_requency.json | 0 .../sample_mflix/schema/comments.json | 24 +-- .../connector/sample_mflix/schema/movies.json | 140 ++++++------------ .../sample_mflix/schema/sessions.json | 12 +- .../sample_mflix/schema/theaters.json | 46 ++---- .../connector/sample_mflix/schema/users.json | 26 +--- 8 files changed, 74 insertions(+), 178 deletions(-) rename fixtures/{ => hasura/sample_mflix}/connector/sample_mflix/native_queries/hello.json (100%) rename fixtures/{ => hasura/sample_mflix}/connector/sample_mflix/native_queries/title_word_requency.json (100%) diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/configuration.json b/fixtures/hasura/sample_mflix/connector/sample_mflix/configuration.json index 3cb0a1c7..71388b75 100644 --- a/fixtures/hasura/sample_mflix/connector/sample_mflix/configuration.json +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/configuration.json @@ -2,6 +2,6 @@ "introspectionOptions": { "sampleSize": 100, "noValidatorSchema": false, - "allSchemaNullable": true + "allSchemaNullable": false, } -} \ No newline at end of file +} diff --git a/fixtures/connector/sample_mflix/native_queries/hello.json b/fixtures/hasura/sample_mflix/connector/sample_mflix/native_queries/hello.json similarity index 100% rename from fixtures/connector/sample_mflix/native_queries/hello.json rename to fixtures/hasura/sample_mflix/connector/sample_mflix/native_queries/hello.json diff --git a/fixtures/connector/sample_mflix/native_queries/title_word_requency.json b/fixtures/hasura/sample_mflix/connector/sample_mflix/native_queries/title_word_requency.json similarity index 100% rename from fixtures/connector/sample_mflix/native_queries/title_word_requency.json rename to fixtures/hasura/sample_mflix/connector/sample_mflix/native_queries/title_word_requency.json diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/comments.json b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/comments.json index 081e0eea..bc8d022e 100644 --- a/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/comments.json +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/comments.json @@ -10,44 +10,32 @@ "fields": { "_id": { "type": { - "nullable": { - "scalar": "objectId" - } + "scalar": "objectId" } }, "date": { "type": { - "nullable": { - "scalar": "date" - } + "scalar": "date" } }, "email": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "movie_id": { "type": { - "nullable": { - "scalar": "objectId" - } + "scalar": "objectId" } }, "name": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "text": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } } } diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/movies.json b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/movies.json index 9c46d6de..bb96aee5 100644 --- a/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/movies.json +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/movies.json @@ -10,16 +10,12 @@ "fields": { "_id": { "type": { - "nullable": { - "scalar": "objectId" - } + "scalar": "objectId" } }, "awards": { "type": { - "nullable": { - "object": "movies_awards" - } + "object": "movies_awards" } }, "cast": { @@ -33,59 +29,45 @@ }, "countries": { "type": { - "nullable": { - "arrayOf": { - "scalar": "string" - } + "arrayOf": { + "scalar": "string" } } }, "directors": { "type": { - "nullable": { - "arrayOf": { - "scalar": "string" - } + "arrayOf": { + "scalar": "string" } } }, "fullplot": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "genres": { "type": { - "nullable": { - "arrayOf": { - "scalar": "string" - } + "arrayOf": { + "scalar": "string" } } }, "imdb": { "type": { - "nullable": { - "object": "movies_imdb" - } + "object": "movies_imdb" } }, "languages": { "type": { - "nullable": { - "arrayOf": { - "scalar": "string" - } + "arrayOf": { + "scalar": "string" } } }, "lastupdated": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "metacritic": { @@ -104,16 +86,12 @@ }, "plot": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "poster": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "rated": { @@ -125,53 +103,39 @@ }, "released": { "type": { - "nullable": { - "scalar": "date" - } + "scalar": "date" } }, "runtime": { "type": { - "nullable": { - "scalar": "int" - } + "scalar": "int" } }, "title": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "tomatoes": { "type": { - "nullable": { - "object": "movies_tomatoes" - } + "object": "movies_tomatoes" } }, "type": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "writers": { "type": { - "nullable": { - "arrayOf": { - "scalar": "string" - } + "arrayOf": { + "scalar": "string" } } }, "year": { "type": { - "nullable": { - "scalar": "int" - } + "scalar": "int" } } } @@ -180,23 +144,17 @@ "fields": { "nominations": { "type": { - "nullable": { - "scalar": "int" - } + "scalar": "int" } }, "text": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "wins": { "type": { - "nullable": { - "scalar": "int" - } + "scalar": "int" } } } @@ -205,19 +163,17 @@ "fields": { "id": { "type": { - "nullable": { - "scalar": "int" - } + "scalar": "int" } }, "rating": { - "type": "extendedJSON" + "type": { + "scalar": "double" + } }, "votes": { "type": { - "nullable": { - "scalar": "int" - } + "scalar": "int" } } } @@ -261,9 +217,7 @@ }, "lastUpdated": { "type": { - "nullable": { - "scalar": "date" - } + "scalar": "date" } }, "production": { @@ -282,9 +236,7 @@ }, "viewer": { "type": { - "nullable": { - "object": "movies_tomatoes_viewer" - } + "object": "movies_tomatoes_viewer" } }, "website": { @@ -307,13 +259,15 @@ }, "numReviews": { "type": { - "nullable": { - "scalar": "int" - } + "scalar": "int" } }, "rating": { - "type": "extendedJSON" + "type": { + "nullable": { + "scalar": "double" + } + } } } }, @@ -321,22 +275,22 @@ "fields": { "meter": { "type": { - "nullable": { - "scalar": "int" - } + "scalar": "int" } }, "numReviews": { "type": { - "nullable": { - "scalar": "int" - } + "scalar": "int" } }, "rating": { - "type": "extendedJSON" + "type": { + "nullable": { + "scalar": "double" + } + } } } } } -} \ No newline at end of file +} diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/sessions.json b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/sessions.json index bbb5cd9f..364b9050 100644 --- a/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/sessions.json +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/sessions.json @@ -10,23 +10,17 @@ "fields": { "_id": { "type": { - "nullable": { - "scalar": "objectId" - } + "scalar": "objectId" } }, "jwt": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "user_id": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } } } diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/theaters.json b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/theaters.json index b19534c7..df44678b 100644 --- a/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/theaters.json +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/theaters.json @@ -10,23 +10,17 @@ "fields": { "_id": { "type": { - "nullable": { - "scalar": "objectId" - } + "scalar": "objectId" } }, "location": { "type": { - "nullable": { - "object": "theaters_location" - } + "object": "theaters_location" } }, "theaterId": { "type": { - "nullable": { - "scalar": "int" - } + "scalar": "int" } } } @@ -35,16 +29,12 @@ "fields": { "address": { "type": { - "nullable": { - "object": "theaters_location_address" - } + "object": "theaters_location_address" } }, "geo": { "type": { - "nullable": { - "object": "theaters_location_geo" - } + "object": "theaters_location_geo" } } } @@ -53,23 +43,17 @@ "fields": { "city": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "state": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "street1": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "street2": { @@ -81,9 +65,7 @@ }, "zipcode": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } } } @@ -92,18 +74,14 @@ "fields": { "coordinates": { "type": { - "nullable": { - "arrayOf": { - "scalar": "double" - } + "arrayOf": { + "scalar": "double" } } }, "type": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } } } diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/users.json b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/users.json index 7d06e3f0..71e27cec 100644 --- a/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/users.json +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/users.json @@ -10,43 +10,25 @@ "fields": { "_id": { "type": { - "nullable": { - "scalar": "objectId" - } + "scalar": "objectId" } }, "email": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "name": { "type": { - "nullable": { - "scalar": "string" - } + "scalar": "string" } }, "password": { "type": { - "nullable": { - "scalar": "string" - } - } - }, - "preferences": { - "type": { - "nullable": { - "object": "users_preferences" - } + "scalar": "string" } } } - }, - "users_preferences": { - "fields": {} } } } \ No newline at end of file From 1e8bedbd81761dc687eccd7ef8af950eb73037fd Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Thu, 13 Jun 2024 14:38:04 -0700 Subject: [PATCH 12/34] introspect chinook --- .../connector/chinook/.configuration_metadata | 0 .../connector/chinook/configuration.json | 7 + .../connector/chinook/schema/Album.json | 37 ++++++ .../connector/chinook/schema/Artist.json | 34 +++++ .../connector/chinook/schema/Customer.json | 105 +++++++++++++++ .../connector/chinook/schema/Employee.json | 121 ++++++++++++++++++ .../connector/chinook/schema/Genre.json | 34 +++++ .../connector/chinook/schema/Invoice.json | 77 +++++++++++ .../connector/chinook/schema/InvoiceLine.json | 47 +++++++ .../connector/chinook/schema/MediaType.json | 34 +++++ .../connector/chinook/schema/Playlist.json | 34 +++++ .../chinook/schema/PlaylistTrack.json | 32 +++++ .../connector/chinook/schema/Track.json | 75 +++++++++++ 13 files changed, 637 insertions(+) create mode 100644 fixtures/hasura/chinook/connector/chinook/.configuration_metadata create mode 100644 fixtures/hasura/chinook/connector/chinook/configuration.json create mode 100644 fixtures/hasura/chinook/connector/chinook/schema/Album.json create mode 100644 fixtures/hasura/chinook/connector/chinook/schema/Artist.json create mode 100644 fixtures/hasura/chinook/connector/chinook/schema/Customer.json create mode 100644 fixtures/hasura/chinook/connector/chinook/schema/Employee.json create mode 100644 fixtures/hasura/chinook/connector/chinook/schema/Genre.json create mode 100644 fixtures/hasura/chinook/connector/chinook/schema/Invoice.json create mode 100644 fixtures/hasura/chinook/connector/chinook/schema/InvoiceLine.json create mode 100644 fixtures/hasura/chinook/connector/chinook/schema/MediaType.json create mode 100644 fixtures/hasura/chinook/connector/chinook/schema/Playlist.json create mode 100644 fixtures/hasura/chinook/connector/chinook/schema/PlaylistTrack.json create mode 100644 fixtures/hasura/chinook/connector/chinook/schema/Track.json diff --git a/fixtures/hasura/chinook/connector/chinook/.configuration_metadata b/fixtures/hasura/chinook/connector/chinook/.configuration_metadata new file mode 100644 index 00000000..e69de29b diff --git a/fixtures/hasura/chinook/connector/chinook/configuration.json b/fixtures/hasura/chinook/connector/chinook/configuration.json new file mode 100644 index 00000000..3cb0a1c7 --- /dev/null +++ b/fixtures/hasura/chinook/connector/chinook/configuration.json @@ -0,0 +1,7 @@ +{ + "introspectionOptions": { + "sampleSize": 100, + "noValidatorSchema": false, + "allSchemaNullable": true + } +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/chinook/schema/Album.json b/fixtures/hasura/chinook/connector/chinook/schema/Album.json new file mode 100644 index 00000000..9ccc9974 --- /dev/null +++ b/fixtures/hasura/chinook/connector/chinook/schema/Album.json @@ -0,0 +1,37 @@ +{ + "name": "Album", + "collections": { + "Album": { + "type": "Album" + } + }, + "objectTypes": { + "Album": { + "fields": { + "AlbumId": { + "type": { + "scalar": "int" + } + }, + "ArtistId": { + "type": { + "scalar": "int" + } + }, + "Title": { + "type": { + "scalar": "string" + } + }, + "_id": { + "type": { + "nullable": { + "scalar": "objectId" + } + } + } + }, + "description": "Object type for collection Album" + } + } +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/chinook/schema/Artist.json b/fixtures/hasura/chinook/connector/chinook/schema/Artist.json new file mode 100644 index 00000000..3f19aec5 --- /dev/null +++ b/fixtures/hasura/chinook/connector/chinook/schema/Artist.json @@ -0,0 +1,34 @@ +{ + "name": "Artist", + "collections": { + "Artist": { + "type": "Artist" + } + }, + "objectTypes": { + "Artist": { + "fields": { + "ArtistId": { + "type": { + "scalar": "int" + } + }, + "Name": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "_id": { + "type": { + "nullable": { + "scalar": "objectId" + } + } + } + }, + "description": "Object type for collection Artist" + } + } +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/chinook/schema/Customer.json b/fixtures/hasura/chinook/connector/chinook/schema/Customer.json new file mode 100644 index 00000000..61156790 --- /dev/null +++ b/fixtures/hasura/chinook/connector/chinook/schema/Customer.json @@ -0,0 +1,105 @@ +{ + "name": "Customer", + "collections": { + "Customer": { + "type": "Customer" + } + }, + "objectTypes": { + "Customer": { + "fields": { + "Address": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "City": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "Company": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "Country": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "CustomerId": { + "type": { + "scalar": "int" + } + }, + "Email": { + "type": { + "scalar": "string" + } + }, + "Fax": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "FirstName": { + "type": { + "scalar": "string" + } + }, + "LastName": { + "type": { + "scalar": "string" + } + }, + "Phone": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "PostalCode": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "State": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "SupportRepId": { + "type": { + "nullable": { + "scalar": "int" + } + } + }, + "_id": { + "type": { + "nullable": { + "scalar": "objectId" + } + } + } + }, + "description": "Object type for collection Customer" + } + } +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/chinook/schema/Employee.json b/fixtures/hasura/chinook/connector/chinook/schema/Employee.json new file mode 100644 index 00000000..c93bf807 --- /dev/null +++ b/fixtures/hasura/chinook/connector/chinook/schema/Employee.json @@ -0,0 +1,121 @@ +{ + "name": "Employee", + "collections": { + "Employee": { + "type": "Employee" + } + }, + "objectTypes": { + "Employee": { + "fields": { + "Address": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "BirthDate": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "City": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "Country": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "Email": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "EmployeeId": { + "type": { + "scalar": "int" + } + }, + "Fax": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "FirstName": { + "type": { + "scalar": "string" + } + }, + "HireDate": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "LastName": { + "type": { + "scalar": "string" + } + }, + "Phone": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "PostalCode": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "ReportsTo": { + "type": { + "nullable": { + "scalar": "int" + } + } + }, + "State": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "Title": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "_id": { + "type": { + "nullable": { + "scalar": "objectId" + } + } + } + }, + "description": "Object type for collection Employee" + } + } +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/chinook/schema/Genre.json b/fixtures/hasura/chinook/connector/chinook/schema/Genre.json new file mode 100644 index 00000000..c3e07a3f --- /dev/null +++ b/fixtures/hasura/chinook/connector/chinook/schema/Genre.json @@ -0,0 +1,34 @@ +{ + "name": "Genre", + "collections": { + "Genre": { + "type": "Genre" + } + }, + "objectTypes": { + "Genre": { + "fields": { + "GenreId": { + "type": { + "scalar": "int" + } + }, + "Name": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "_id": { + "type": { + "nullable": { + "scalar": "objectId" + } + } + } + }, + "description": "Object type for collection Genre" + } + } +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/chinook/schema/Invoice.json b/fixtures/hasura/chinook/connector/chinook/schema/Invoice.json new file mode 100644 index 00000000..2e03ba68 --- /dev/null +++ b/fixtures/hasura/chinook/connector/chinook/schema/Invoice.json @@ -0,0 +1,77 @@ +{ + "name": "Invoice", + "collections": { + "Invoice": { + "type": "Invoice" + } + }, + "objectTypes": { + "Invoice": { + "fields": { + "BillingAddress": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "BillingCity": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "BillingCountry": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "BillingPostalCode": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "BillingState": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "CustomerId": { + "type": { + "scalar": "int" + } + }, + "InvoiceDate": { + "type": { + "scalar": "string" + } + }, + "InvoiceId": { + "type": { + "scalar": "int" + } + }, + "Total": { + "type": { + "scalar": "decimal" + } + }, + "_id": { + "type": { + "nullable": { + "scalar": "objectId" + } + } + } + }, + "description": "Object type for collection Invoice" + } + } +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/chinook/schema/InvoiceLine.json b/fixtures/hasura/chinook/connector/chinook/schema/InvoiceLine.json new file mode 100644 index 00000000..a4095b15 --- /dev/null +++ b/fixtures/hasura/chinook/connector/chinook/schema/InvoiceLine.json @@ -0,0 +1,47 @@ +{ + "name": "InvoiceLine", + "collections": { + "InvoiceLine": { + "type": "InvoiceLine" + } + }, + "objectTypes": { + "InvoiceLine": { + "fields": { + "InvoiceId": { + "type": { + "scalar": "int" + } + }, + "InvoiceLineId": { + "type": { + "scalar": "int" + } + }, + "Quantity": { + "type": { + "scalar": "int" + } + }, + "TrackId": { + "type": { + "scalar": "int" + } + }, + "UnitPrice": { + "type": { + "scalar": "decimal" + } + }, + "_id": { + "type": { + "nullable": { + "scalar": "objectId" + } + } + } + }, + "description": "Object type for collection InvoiceLine" + } + } +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/chinook/schema/MediaType.json b/fixtures/hasura/chinook/connector/chinook/schema/MediaType.json new file mode 100644 index 00000000..a3811166 --- /dev/null +++ b/fixtures/hasura/chinook/connector/chinook/schema/MediaType.json @@ -0,0 +1,34 @@ +{ + "name": "MediaType", + "collections": { + "MediaType": { + "type": "MediaType" + } + }, + "objectTypes": { + "MediaType": { + "fields": { + "MediaTypeId": { + "type": { + "scalar": "int" + } + }, + "Name": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "_id": { + "type": { + "nullable": { + "scalar": "objectId" + } + } + } + }, + "description": "Object type for collection MediaType" + } + } +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/chinook/schema/Playlist.json b/fixtures/hasura/chinook/connector/chinook/schema/Playlist.json new file mode 100644 index 00000000..3d22bd7a --- /dev/null +++ b/fixtures/hasura/chinook/connector/chinook/schema/Playlist.json @@ -0,0 +1,34 @@ +{ + "name": "Playlist", + "collections": { + "Playlist": { + "type": "Playlist" + } + }, + "objectTypes": { + "Playlist": { + "fields": { + "Name": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "PlaylistId": { + "type": { + "scalar": "int" + } + }, + "_id": { + "type": { + "nullable": { + "scalar": "objectId" + } + } + } + }, + "description": "Object type for collection Playlist" + } + } +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/chinook/schema/PlaylistTrack.json b/fixtures/hasura/chinook/connector/chinook/schema/PlaylistTrack.json new file mode 100644 index 00000000..649b0cd5 --- /dev/null +++ b/fixtures/hasura/chinook/connector/chinook/schema/PlaylistTrack.json @@ -0,0 +1,32 @@ +{ + "name": "PlaylistTrack", + "collections": { + "PlaylistTrack": { + "type": "PlaylistTrack" + } + }, + "objectTypes": { + "PlaylistTrack": { + "fields": { + "PlaylistId": { + "type": { + "scalar": "int" + } + }, + "TrackId": { + "type": { + "scalar": "int" + } + }, + "_id": { + "type": { + "nullable": { + "scalar": "objectId" + } + } + } + }, + "description": "Object type for collection PlaylistTrack" + } + } +} \ No newline at end of file diff --git a/fixtures/hasura/chinook/connector/chinook/schema/Track.json b/fixtures/hasura/chinook/connector/chinook/schema/Track.json new file mode 100644 index 00000000..c8e06cf0 --- /dev/null +++ b/fixtures/hasura/chinook/connector/chinook/schema/Track.json @@ -0,0 +1,75 @@ +{ + "name": "Track", + "collections": { + "Track": { + "type": "Track" + } + }, + "objectTypes": { + "Track": { + "fields": { + "AlbumId": { + "type": { + "nullable": { + "scalar": "int" + } + } + }, + "Bytes": { + "type": { + "nullable": { + "scalar": "int" + } + } + }, + "Composer": { + "type": { + "nullable": { + "scalar": "string" + } + } + }, + "GenreId": { + "type": { + "nullable": { + "scalar": "int" + } + } + }, + "MediaTypeId": { + "type": { + "scalar": "int" + } + }, + "Milliseconds": { + "type": { + "scalar": "int" + } + }, + "Name": { + "type": { + "scalar": "string" + } + }, + "TrackId": { + "type": { + "scalar": "int" + } + }, + "UnitPrice": { + "type": { + "scalar": "decimal" + } + }, + "_id": { + "type": { + "nullable": { + "scalar": "objectId" + } + } + } + }, + "description": "Object type for collection Track" + } + } +} \ No newline at end of file From 3ab36a17b51e7f76b258fd49e22891cb02528304 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Thu, 13 Jun 2024 14:39:23 -0700 Subject: [PATCH 13/34] copy over chinook config --- .../connector/chinook/configuration.json | 4 +- .../native_mutations/insert_artist.json | 44 +++++++++++++++++++ .../connector/chinook/schema/Album.json | 6 +-- .../connector/chinook/schema/Artist.json | 6 +-- .../connector/chinook/schema/Customer.json | 6 +-- .../connector/chinook/schema/Employee.json | 6 +-- .../connector/chinook/schema/Genre.json | 6 +-- .../connector/chinook/schema/Invoice.json | 6 +-- .../connector/chinook/schema/InvoiceLine.json | 6 +-- .../connector/chinook/schema/MediaType.json | 6 +-- .../connector/chinook/schema/Playlist.json | 6 +-- .../chinook/schema/PlaylistTrack.json | 6 +-- .../connector/chinook/schema/Track.json | 6 +-- 13 files changed, 68 insertions(+), 46 deletions(-) create mode 100644 fixtures/hasura/chinook/connector/chinook/native_mutations/insert_artist.json diff --git a/fixtures/hasura/chinook/connector/chinook/configuration.json b/fixtures/hasura/chinook/connector/chinook/configuration.json index 3cb0a1c7..e2c0aaab 100644 --- a/fixtures/hasura/chinook/connector/chinook/configuration.json +++ b/fixtures/hasura/chinook/connector/chinook/configuration.json @@ -2,6 +2,6 @@ "introspectionOptions": { "sampleSize": 100, "noValidatorSchema": false, - "allSchemaNullable": true + "allSchemaNullable": false } -} \ No newline at end of file +} diff --git a/fixtures/hasura/chinook/connector/chinook/native_mutations/insert_artist.json b/fixtures/hasura/chinook/connector/chinook/native_mutations/insert_artist.json new file mode 100644 index 00000000..d9e6051d --- /dev/null +++ b/fixtures/hasura/chinook/connector/chinook/native_mutations/insert_artist.json @@ -0,0 +1,44 @@ +{ + "name": "insertArtist", + "description": "Example of a database update using a native mutation", + "resultType": { + "object": "InsertArtist" + }, + "arguments": { + "id": { + "type": { + "scalar": "int" + } + }, + "name": { + "type": { + "scalar": "string" + } + } + }, + "objectTypes": { + "InsertArtist": { + "fields": { + "ok": { + "type": { + "scalar": "double" + } + }, + "n": { + "type": { + "scalar": "int" + } + } + } + } + }, + "command": { + "insert": "Artist", + "documents": [ + { + "ArtistId": "{{ id }}", + "Name": "{{ name }}" + } + ] + } +} diff --git a/fixtures/hasura/chinook/connector/chinook/schema/Album.json b/fixtures/hasura/chinook/connector/chinook/schema/Album.json index 9ccc9974..a8e61389 100644 --- a/fixtures/hasura/chinook/connector/chinook/schema/Album.json +++ b/fixtures/hasura/chinook/connector/chinook/schema/Album.json @@ -25,13 +25,11 @@ }, "_id": { "type": { - "nullable": { - "scalar": "objectId" - } + "scalar": "objectId" } } }, "description": "Object type for collection Album" } } -} \ No newline at end of file +} diff --git a/fixtures/hasura/chinook/connector/chinook/schema/Artist.json b/fixtures/hasura/chinook/connector/chinook/schema/Artist.json index 3f19aec5..d60bb483 100644 --- a/fixtures/hasura/chinook/connector/chinook/schema/Artist.json +++ b/fixtures/hasura/chinook/connector/chinook/schema/Artist.json @@ -22,13 +22,11 @@ }, "_id": { "type": { - "nullable": { - "scalar": "objectId" - } + "scalar": "objectId" } } }, "description": "Object type for collection Artist" } } -} \ No newline at end of file +} diff --git a/fixtures/hasura/chinook/connector/chinook/schema/Customer.json b/fixtures/hasura/chinook/connector/chinook/schema/Customer.json index 61156790..50dbf947 100644 --- a/fixtures/hasura/chinook/connector/chinook/schema/Customer.json +++ b/fixtures/hasura/chinook/connector/chinook/schema/Customer.json @@ -93,13 +93,11 @@ }, "_id": { "type": { - "nullable": { - "scalar": "objectId" - } + "scalar": "objectId" } } }, "description": "Object type for collection Customer" } } -} \ No newline at end of file +} diff --git a/fixtures/hasura/chinook/connector/chinook/schema/Employee.json b/fixtures/hasura/chinook/connector/chinook/schema/Employee.json index c93bf807..d6a0524e 100644 --- a/fixtures/hasura/chinook/connector/chinook/schema/Employee.json +++ b/fixtures/hasura/chinook/connector/chinook/schema/Employee.json @@ -109,13 +109,11 @@ }, "_id": { "type": { - "nullable": { - "scalar": "objectId" - } + "scalar": "objectId" } } }, "description": "Object type for collection Employee" } } -} \ No newline at end of file +} diff --git a/fixtures/hasura/chinook/connector/chinook/schema/Genre.json b/fixtures/hasura/chinook/connector/chinook/schema/Genre.json index c3e07a3f..99cdb709 100644 --- a/fixtures/hasura/chinook/connector/chinook/schema/Genre.json +++ b/fixtures/hasura/chinook/connector/chinook/schema/Genre.json @@ -22,13 +22,11 @@ }, "_id": { "type": { - "nullable": { - "scalar": "objectId" - } + "scalar": "objectId" } } }, "description": "Object type for collection Genre" } } -} \ No newline at end of file +} diff --git a/fixtures/hasura/chinook/connector/chinook/schema/Invoice.json b/fixtures/hasura/chinook/connector/chinook/schema/Invoice.json index 2e03ba68..aa9a3c91 100644 --- a/fixtures/hasura/chinook/connector/chinook/schema/Invoice.json +++ b/fixtures/hasura/chinook/connector/chinook/schema/Invoice.json @@ -65,13 +65,11 @@ }, "_id": { "type": { - "nullable": { - "scalar": "objectId" - } + "scalar": "objectId" } } }, "description": "Object type for collection Invoice" } } -} \ No newline at end of file +} diff --git a/fixtures/hasura/chinook/connector/chinook/schema/InvoiceLine.json b/fixtures/hasura/chinook/connector/chinook/schema/InvoiceLine.json index a4095b15..438d023b 100644 --- a/fixtures/hasura/chinook/connector/chinook/schema/InvoiceLine.json +++ b/fixtures/hasura/chinook/connector/chinook/schema/InvoiceLine.json @@ -35,13 +35,11 @@ }, "_id": { "type": { - "nullable": { - "scalar": "objectId" - } + "scalar": "objectId" } } }, "description": "Object type for collection InvoiceLine" } } -} \ No newline at end of file +} diff --git a/fixtures/hasura/chinook/connector/chinook/schema/MediaType.json b/fixtures/hasura/chinook/connector/chinook/schema/MediaType.json index a3811166..79912879 100644 --- a/fixtures/hasura/chinook/connector/chinook/schema/MediaType.json +++ b/fixtures/hasura/chinook/connector/chinook/schema/MediaType.json @@ -22,13 +22,11 @@ }, "_id": { "type": { - "nullable": { - "scalar": "objectId" - } + "scalar": "objectId" } } }, "description": "Object type for collection MediaType" } } -} \ No newline at end of file +} diff --git a/fixtures/hasura/chinook/connector/chinook/schema/Playlist.json b/fixtures/hasura/chinook/connector/chinook/schema/Playlist.json index 3d22bd7a..74dee27f 100644 --- a/fixtures/hasura/chinook/connector/chinook/schema/Playlist.json +++ b/fixtures/hasura/chinook/connector/chinook/schema/Playlist.json @@ -22,13 +22,11 @@ }, "_id": { "type": { - "nullable": { - "scalar": "objectId" - } + "scalar": "objectId" } } }, "description": "Object type for collection Playlist" } } -} \ No newline at end of file +} diff --git a/fixtures/hasura/chinook/connector/chinook/schema/PlaylistTrack.json b/fixtures/hasura/chinook/connector/chinook/schema/PlaylistTrack.json index 649b0cd5..e4382592 100644 --- a/fixtures/hasura/chinook/connector/chinook/schema/PlaylistTrack.json +++ b/fixtures/hasura/chinook/connector/chinook/schema/PlaylistTrack.json @@ -20,13 +20,11 @@ }, "_id": { "type": { - "nullable": { - "scalar": "objectId" - } + "scalar": "objectId" } } }, "description": "Object type for collection PlaylistTrack" } } -} \ No newline at end of file +} diff --git a/fixtures/hasura/chinook/connector/chinook/schema/Track.json b/fixtures/hasura/chinook/connector/chinook/schema/Track.json index c8e06cf0..a0d11820 100644 --- a/fixtures/hasura/chinook/connector/chinook/schema/Track.json +++ b/fixtures/hasura/chinook/connector/chinook/schema/Track.json @@ -63,13 +63,11 @@ }, "_id": { "type": { - "nullable": { - "scalar": "objectId" - } + "scalar": "objectId" } } }, "description": "Object type for collection Track" } } -} \ No newline at end of file +} From ff1291afc5c0c6d5e7c0f2c120d09f2ad97fbdc9 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Thu, 13 Jun 2024 15:13:13 -0700 Subject: [PATCH 14/34] add dataconnector links --- fixtures/hasura/chinook/.env.chinook | 1 + fixtures/hasura/chinook/metadata/chinook.hml | 23 +++++++++++++++++++ .../hasura/sample_mflix/.env.sample_mflix | 1 + .../sample_mflix/metadata/sample_mflix.hml | 23 +++++++++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 fixtures/hasura/chinook/metadata/chinook.hml create mode 100644 fixtures/hasura/sample_mflix/metadata/sample_mflix.hml diff --git a/fixtures/hasura/chinook/.env.chinook b/fixtures/hasura/chinook/.env.chinook index e69de29b..b52c724f 100644 --- a/fixtures/hasura/chinook/.env.chinook +++ b/fixtures/hasura/chinook/.env.chinook @@ -0,0 +1 @@ +CHINOOK_CONNECTOR_URL='http://localhost:7131' diff --git a/fixtures/hasura/chinook/metadata/chinook.hml b/fixtures/hasura/chinook/metadata/chinook.hml new file mode 100644 index 00000000..7c3ce00e --- /dev/null +++ b/fixtures/hasura/chinook/metadata/chinook.hml @@ -0,0 +1,23 @@ +kind: DataConnectorLink +version: v1 +definition: + name: chinook + url: + readWriteUrls: + read: + valueFromEnv: CHINOOK_CONNECTOR_URL + write: + valueFromEnv: CHINOOK_CONNECTOR_URL + schema: + version: v0.1 + schema: + scalar_types: {} + object_types: {} + collections: [] + functions: [] + procedures: [] + capabilities: + version: "" + capabilities: + query: {} + mutation: {} diff --git a/fixtures/hasura/sample_mflix/.env.sample_mflix b/fixtures/hasura/sample_mflix/.env.sample_mflix index e69de29b..e003fd5a 100644 --- a/fixtures/hasura/sample_mflix/.env.sample_mflix +++ b/fixtures/hasura/sample_mflix/.env.sample_mflix @@ -0,0 +1 @@ +SAMPLE_MFLIX_CONNECTOR_URL='http://localhost:7130' diff --git a/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml b/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml new file mode 100644 index 00000000..e69bed35 --- /dev/null +++ b/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml @@ -0,0 +1,23 @@ +kind: DataConnectorLink +version: v1 +definition: + name: sample_mflix + url: + readWriteUrls: + read: + valueFromEnv: SAMPLE_MFLIX_CONNECTOR_URL + write: + valueFromEnv: SAMPLE_MFLIX_CONNECTOR_URL + schema: + version: v0.1 + schema: + scalar_types: {} + object_types: {} + collections: [] + functions: [] + procedures: [] + capabilities: + version: "" + capabilities: + query: {} + mutation: {} From 4ec6b10e24f8770fe2b80f6a757966d10f4cc0a7 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Thu, 13 Jun 2024 15:16:15 -0700 Subject: [PATCH 15/34] write schema info to dataconnector metadata --- fixtures/hasura/chinook/metadata/chinook.hml | 1034 ++++++++++++++++- .../sample_mflix/metadata/sample_mflix.hml | 944 ++++++++++++++- 2 files changed, 1966 insertions(+), 12 deletions(-) diff --git a/fixtures/hasura/chinook/metadata/chinook.hml b/fixtures/hasura/chinook/metadata/chinook.hml index 7c3ce00e..487f72a4 100644 --- a/fixtures/hasura/chinook/metadata/chinook.hml +++ b/fixtures/hasura/chinook/metadata/chinook.hml @@ -11,13 +11,1035 @@ definition: schema: version: v0.1 schema: - scalar_types: {} - object_types: {} - collections: [] + scalar_types: + BinData: + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: + _eq: + type: equal + _neq: + type: custom + argument_type: + type: named + name: BinData + Bool: + representation: + type: boolean + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: + _eq: + type: equal + _neq: + type: custom + argument_type: + type: named + name: Bool + Date: + representation: + type: timestamp + aggregate_functions: + count: + result_type: + type: named + name: Int + max: + result_type: + type: named + name: Date + min: + result_type: + type: named + name: Date + comparison_operators: + _eq: + type: equal + _gt: + type: custom + argument_type: + type: named + name: Date + _gte: + type: custom + argument_type: + type: named + name: Date + _lt: + type: custom + argument_type: + type: named + name: Date + _lte: + type: custom + argument_type: + type: named + name: Date + _neq: + type: custom + argument_type: + type: named + name: Date + DbPointer: + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: + _eq: + type: equal + _neq: + type: custom + argument_type: + type: named + name: DbPointer + Decimal: + representation: + type: bigdecimal + aggregate_functions: + avg: + result_type: + type: named + name: Decimal + count: + result_type: + type: named + name: Int + max: + result_type: + type: named + name: Decimal + min: + result_type: + type: named + name: Decimal + sum: + result_type: + type: named + name: Decimal + comparison_operators: + _eq: + type: equal + _gt: + type: custom + argument_type: + type: named + name: Decimal + _gte: + type: custom + argument_type: + type: named + name: Decimal + _lt: + type: custom + argument_type: + type: named + name: Decimal + _lte: + type: custom + argument_type: + type: named + name: Decimal + _neq: + type: custom + argument_type: + type: named + name: Decimal + Double: + representation: + type: float64 + aggregate_functions: + avg: + result_type: + type: named + name: Double + count: + result_type: + type: named + name: Int + max: + result_type: + type: named + name: Double + min: + result_type: + type: named + name: Double + sum: + result_type: + type: named + name: Double + comparison_operators: + _eq: + type: equal + _gt: + type: custom + argument_type: + type: named + name: Double + _gte: + type: custom + argument_type: + type: named + name: Double + _lt: + type: custom + argument_type: + type: named + name: Double + _lte: + type: custom + argument_type: + type: named + name: Double + _neq: + type: custom + argument_type: + type: named + name: Double + ExtendedJSON: + representation: + type: json + aggregate_functions: {} + comparison_operators: {} + Int: + representation: + type: int32 + aggregate_functions: + avg: + result_type: + type: named + name: Int + count: + result_type: + type: named + name: Int + max: + result_type: + type: named + name: Int + min: + result_type: + type: named + name: Int + sum: + result_type: + type: named + name: Int + comparison_operators: + _eq: + type: equal + _gt: + type: custom + argument_type: + type: named + name: Int + _gte: + type: custom + argument_type: + type: named + name: Int + _lt: + type: custom + argument_type: + type: named + name: Int + _lte: + type: custom + argument_type: + type: named + name: Int + _neq: + type: custom + argument_type: + type: named + name: Int + Javascript: + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: {} + JavascriptWithScope: + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: {} + Long: + representation: + type: int64 + aggregate_functions: + avg: + result_type: + type: named + name: Long + count: + result_type: + type: named + name: Int + max: + result_type: + type: named + name: Long + min: + result_type: + type: named + name: Long + sum: + result_type: + type: named + name: Long + comparison_operators: + _eq: + type: equal + _gt: + type: custom + argument_type: + type: named + name: Long + _gte: + type: custom + argument_type: + type: named + name: Long + _lt: + type: custom + argument_type: + type: named + name: Long + _lte: + type: custom + argument_type: + type: named + name: Long + _neq: + type: custom + argument_type: + type: named + name: Long + MaxKey: + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: + _eq: + type: equal + _neq: + type: custom + argument_type: + type: named + name: MaxKey + MinKey: + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: + _eq: + type: equal + _neq: + type: custom + argument_type: + type: named + name: MinKey + "Null": + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: + _eq: + type: equal + _neq: + type: custom + argument_type: + type: named + name: "Null" + ObjectId: + representation: + type: string + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: + _eq: + type: equal + _neq: + type: custom + argument_type: + type: named + name: ObjectId + Regex: + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: {} + String: + representation: + type: string + aggregate_functions: + count: + result_type: + type: named + name: Int + max: + result_type: + type: named + name: String + min: + result_type: + type: named + name: String + comparison_operators: + _eq: + type: equal + _gt: + type: custom + argument_type: + type: named + name: String + _gte: + type: custom + argument_type: + type: named + name: String + _iregex: + type: custom + argument_type: + type: named + name: String + _lt: + type: custom + argument_type: + type: named + name: String + _lte: + type: custom + argument_type: + type: named + name: String + _neq: + type: custom + argument_type: + type: named + name: String + _regex: + type: custom + argument_type: + type: named + name: String + Symbol: + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: + _eq: + type: equal + _neq: + type: custom + argument_type: + type: named + name: Symbol + Timestamp: + aggregate_functions: + count: + result_type: + type: named + name: Int + max: + result_type: + type: named + name: Timestamp + min: + result_type: + type: named + name: Timestamp + comparison_operators: + _eq: + type: equal + _gt: + type: custom + argument_type: + type: named + name: Timestamp + _gte: + type: custom + argument_type: + type: named + name: Timestamp + _lt: + type: custom + argument_type: + type: named + name: Timestamp + _lte: + type: custom + argument_type: + type: named + name: Timestamp + _neq: + type: custom + argument_type: + type: named + name: Timestamp + Undefined: + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: + _eq: + type: equal + _neq: + type: custom + argument_type: + type: named + name: Undefined + object_types: + Album: + description: Object type for collection Album + fields: + _id: + type: + type: named + name: ObjectId + AlbumId: + type: + type: named + name: Int + ArtistId: + type: + type: named + name: Int + Title: + type: + type: named + name: String + Artist: + description: Object type for collection Artist + fields: + _id: + type: + type: named + name: ObjectId + ArtistId: + type: + type: named + name: Int + Name: + type: + type: nullable + underlying_type: + type: named + name: String + Customer: + description: Object type for collection Customer + fields: + _id: + type: + type: named + name: ObjectId + Address: + type: + type: nullable + underlying_type: + type: named + name: String + City: + type: + type: nullable + underlying_type: + type: named + name: String + Company: + type: + type: nullable + underlying_type: + type: named + name: String + Country: + type: + type: nullable + underlying_type: + type: named + name: String + CustomerId: + type: + type: named + name: Int + Email: + type: + type: named + name: String + Fax: + type: + type: nullable + underlying_type: + type: named + name: String + FirstName: + type: + type: named + name: String + LastName: + type: + type: named + name: String + Phone: + type: + type: nullable + underlying_type: + type: named + name: String + PostalCode: + type: + type: nullable + underlying_type: + type: named + name: String + State: + type: + type: nullable + underlying_type: + type: named + name: String + SupportRepId: + type: + type: nullable + underlying_type: + type: named + name: Int + Employee: + description: Object type for collection Employee + fields: + _id: + type: + type: named + name: ObjectId + Address: + type: + type: nullable + underlying_type: + type: named + name: String + BirthDate: + type: + type: nullable + underlying_type: + type: named + name: String + City: + type: + type: nullable + underlying_type: + type: named + name: String + Country: + type: + type: nullable + underlying_type: + type: named + name: String + Email: + type: + type: nullable + underlying_type: + type: named + name: String + EmployeeId: + type: + type: named + name: Int + Fax: + type: + type: nullable + underlying_type: + type: named + name: String + FirstName: + type: + type: named + name: String + HireDate: + type: + type: nullable + underlying_type: + type: named + name: String + LastName: + type: + type: named + name: String + Phone: + type: + type: nullable + underlying_type: + type: named + name: String + PostalCode: + type: + type: nullable + underlying_type: + type: named + name: String + ReportsTo: + type: + type: nullable + underlying_type: + type: named + name: Int + State: + type: + type: nullable + underlying_type: + type: named + name: String + Title: + type: + type: nullable + underlying_type: + type: named + name: String + Genre: + description: Object type for collection Genre + fields: + _id: + type: + type: named + name: ObjectId + GenreId: + type: + type: named + name: Int + Name: + type: + type: nullable + underlying_type: + type: named + name: String + InsertArtist: + fields: + "n": + type: + type: named + name: Int + ok: + type: + type: named + name: Double + Invoice: + description: Object type for collection Invoice + fields: + _id: + type: + type: named + name: ObjectId + BillingAddress: + type: + type: nullable + underlying_type: + type: named + name: String + BillingCity: + type: + type: nullable + underlying_type: + type: named + name: String + BillingCountry: + type: + type: nullable + underlying_type: + type: named + name: String + BillingPostalCode: + type: + type: nullable + underlying_type: + type: named + name: String + BillingState: + type: + type: nullable + underlying_type: + type: named + name: String + CustomerId: + type: + type: named + name: Int + InvoiceDate: + type: + type: named + name: String + InvoiceId: + type: + type: named + name: Int + Total: + type: + type: named + name: Decimal + InvoiceLine: + description: Object type for collection InvoiceLine + fields: + _id: + type: + type: named + name: ObjectId + InvoiceId: + type: + type: named + name: Int + InvoiceLineId: + type: + type: named + name: Int + Quantity: + type: + type: named + name: Int + TrackId: + type: + type: named + name: Int + UnitPrice: + type: + type: named + name: Decimal + MediaType: + description: Object type for collection MediaType + fields: + _id: + type: + type: named + name: ObjectId + MediaTypeId: + type: + type: named + name: Int + Name: + type: + type: nullable + underlying_type: + type: named + name: String + Playlist: + description: Object type for collection Playlist + fields: + _id: + type: + type: named + name: ObjectId + Name: + type: + type: nullable + underlying_type: + type: named + name: String + PlaylistId: + type: + type: named + name: Int + PlaylistTrack: + description: Object type for collection PlaylistTrack + fields: + _id: + type: + type: named + name: ObjectId + PlaylistId: + type: + type: named + name: Int + TrackId: + type: + type: named + name: Int + Track: + description: Object type for collection Track + fields: + _id: + type: + type: named + name: ObjectId + AlbumId: + type: + type: nullable + underlying_type: + type: named + name: Int + Bytes: + type: + type: nullable + underlying_type: + type: named + name: Int + Composer: + type: + type: nullable + underlying_type: + type: named + name: String + GenreId: + type: + type: nullable + underlying_type: + type: named + name: Int + MediaTypeId: + type: + type: named + name: Int + Milliseconds: + type: + type: named + name: Int + Name: + type: + type: named + name: String + TrackId: + type: + type: named + name: Int + UnitPrice: + type: + type: named + name: Decimal + collections: + - name: Album + arguments: {} + type: Album + uniqueness_constraints: + Album_id: + unique_columns: + - _id + foreign_keys: {} + - name: Artist + arguments: {} + type: Artist + uniqueness_constraints: + Artist_id: + unique_columns: + - _id + foreign_keys: {} + - name: Customer + arguments: {} + type: Customer + uniqueness_constraints: + Customer_id: + unique_columns: + - _id + foreign_keys: {} + - name: Employee + arguments: {} + type: Employee + uniqueness_constraints: + Employee_id: + unique_columns: + - _id + foreign_keys: {} + - name: Genre + arguments: {} + type: Genre + uniqueness_constraints: + Genre_id: + unique_columns: + - _id + foreign_keys: {} + - name: Invoice + arguments: {} + type: Invoice + uniqueness_constraints: + Invoice_id: + unique_columns: + - _id + foreign_keys: {} + - name: InvoiceLine + arguments: {} + type: InvoiceLine + uniqueness_constraints: + InvoiceLine_id: + unique_columns: + - _id + foreign_keys: {} + - name: MediaType + arguments: {} + type: MediaType + uniqueness_constraints: + MediaType_id: + unique_columns: + - _id + foreign_keys: {} + - name: Playlist + arguments: {} + type: Playlist + uniqueness_constraints: + Playlist_id: + unique_columns: + - _id + foreign_keys: {} + - name: PlaylistTrack + arguments: {} + type: PlaylistTrack + uniqueness_constraints: + PlaylistTrack_id: + unique_columns: + - _id + foreign_keys: {} + - name: Track + arguments: {} + type: Track + uniqueness_constraints: + Track_id: + unique_columns: + - _id + foreign_keys: {} functions: [] - procedures: [] + procedures: + - name: insertArtist + description: Example of a database update using a native mutation + arguments: + id: + type: + type: named + name: Int + name: + type: + type: named + name: String + result_type: + type: named + name: InsertArtist capabilities: - version: "" + version: 0.1.4 capabilities: - query: {} + query: + aggregates: {} + variables: {} + explain: {} mutation: {} + relationships: + relation_comparisons: {} diff --git a/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml b/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml index e69bed35..a984caca 100644 --- a/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml +++ b/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml @@ -11,13 +11,945 @@ definition: schema: version: v0.1 schema: - scalar_types: {} - object_types: {} - collections: [] - functions: [] + scalar_types: + BinData: + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: + _eq: + type: equal + _neq: + type: custom + argument_type: + type: named + name: BinData + Bool: + representation: + type: boolean + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: + _eq: + type: equal + _neq: + type: custom + argument_type: + type: named + name: Bool + Date: + representation: + type: timestamp + aggregate_functions: + count: + result_type: + type: named + name: Int + max: + result_type: + type: named + name: Date + min: + result_type: + type: named + name: Date + comparison_operators: + _eq: + type: equal + _gt: + type: custom + argument_type: + type: named + name: Date + _gte: + type: custom + argument_type: + type: named + name: Date + _lt: + type: custom + argument_type: + type: named + name: Date + _lte: + type: custom + argument_type: + type: named + name: Date + _neq: + type: custom + argument_type: + type: named + name: Date + DbPointer: + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: + _eq: + type: equal + _neq: + type: custom + argument_type: + type: named + name: DbPointer + Decimal: + representation: + type: bigdecimal + aggregate_functions: + avg: + result_type: + type: named + name: Decimal + count: + result_type: + type: named + name: Int + max: + result_type: + type: named + name: Decimal + min: + result_type: + type: named + name: Decimal + sum: + result_type: + type: named + name: Decimal + comparison_operators: + _eq: + type: equal + _gt: + type: custom + argument_type: + type: named + name: Decimal + _gte: + type: custom + argument_type: + type: named + name: Decimal + _lt: + type: custom + argument_type: + type: named + name: Decimal + _lte: + type: custom + argument_type: + type: named + name: Decimal + _neq: + type: custom + argument_type: + type: named + name: Decimal + Double: + representation: + type: float64 + aggregate_functions: + avg: + result_type: + type: named + name: Double + count: + result_type: + type: named + name: Int + max: + result_type: + type: named + name: Double + min: + result_type: + type: named + name: Double + sum: + result_type: + type: named + name: Double + comparison_operators: + _eq: + type: equal + _gt: + type: custom + argument_type: + type: named + name: Double + _gte: + type: custom + argument_type: + type: named + name: Double + _lt: + type: custom + argument_type: + type: named + name: Double + _lte: + type: custom + argument_type: + type: named + name: Double + _neq: + type: custom + argument_type: + type: named + name: Double + ExtendedJSON: + representation: + type: json + aggregate_functions: {} + comparison_operators: {} + Int: + representation: + type: int32 + aggregate_functions: + avg: + result_type: + type: named + name: Int + count: + result_type: + type: named + name: Int + max: + result_type: + type: named + name: Int + min: + result_type: + type: named + name: Int + sum: + result_type: + type: named + name: Int + comparison_operators: + _eq: + type: equal + _gt: + type: custom + argument_type: + type: named + name: Int + _gte: + type: custom + argument_type: + type: named + name: Int + _lt: + type: custom + argument_type: + type: named + name: Int + _lte: + type: custom + argument_type: + type: named + name: Int + _neq: + type: custom + argument_type: + type: named + name: Int + Javascript: + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: {} + JavascriptWithScope: + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: {} + Long: + representation: + type: int64 + aggregate_functions: + avg: + result_type: + type: named + name: Long + count: + result_type: + type: named + name: Int + max: + result_type: + type: named + name: Long + min: + result_type: + type: named + name: Long + sum: + result_type: + type: named + name: Long + comparison_operators: + _eq: + type: equal + _gt: + type: custom + argument_type: + type: named + name: Long + _gte: + type: custom + argument_type: + type: named + name: Long + _lt: + type: custom + argument_type: + type: named + name: Long + _lte: + type: custom + argument_type: + type: named + name: Long + _neq: + type: custom + argument_type: + type: named + name: Long + MaxKey: + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: + _eq: + type: equal + _neq: + type: custom + argument_type: + type: named + name: MaxKey + MinKey: + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: + _eq: + type: equal + _neq: + type: custom + argument_type: + type: named + name: MinKey + "Null": + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: + _eq: + type: equal + _neq: + type: custom + argument_type: + type: named + name: "Null" + ObjectId: + representation: + type: string + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: + _eq: + type: equal + _neq: + type: custom + argument_type: + type: named + name: ObjectId + Regex: + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: {} + String: + representation: + type: string + aggregate_functions: + count: + result_type: + type: named + name: Int + max: + result_type: + type: named + name: String + min: + result_type: + type: named + name: String + comparison_operators: + _eq: + type: equal + _gt: + type: custom + argument_type: + type: named + name: String + _gte: + type: custom + argument_type: + type: named + name: String + _iregex: + type: custom + argument_type: + type: named + name: String + _lt: + type: custom + argument_type: + type: named + name: String + _lte: + type: custom + argument_type: + type: named + name: String + _neq: + type: custom + argument_type: + type: named + name: String + _regex: + type: custom + argument_type: + type: named + name: String + Symbol: + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: + _eq: + type: equal + _neq: + type: custom + argument_type: + type: named + name: Symbol + Timestamp: + aggregate_functions: + count: + result_type: + type: named + name: Int + max: + result_type: + type: named + name: Timestamp + min: + result_type: + type: named + name: Timestamp + comparison_operators: + _eq: + type: equal + _gt: + type: custom + argument_type: + type: named + name: Timestamp + _gte: + type: custom + argument_type: + type: named + name: Timestamp + _lt: + type: custom + argument_type: + type: named + name: Timestamp + _lte: + type: custom + argument_type: + type: named + name: Timestamp + _neq: + type: custom + argument_type: + type: named + name: Timestamp + Undefined: + aggregate_functions: + count: + result_type: + type: named + name: Int + comparison_operators: + _eq: + type: equal + _neq: + type: custom + argument_type: + type: named + name: Undefined + object_types: + Hello: + fields: + __value: + type: + type: named + name: String + TitleWordFrequency: + fields: + _id: + type: + type: named + name: String + count: + type: + type: named + name: Int + comments: + fields: + _id: + type: + type: named + name: ObjectId + date: + type: + type: named + name: Date + email: + type: + type: named + name: String + movie_id: + type: + type: named + name: ObjectId + name: + type: + type: named + name: String + text: + type: + type: named + name: String + movies: + fields: + _id: + type: + type: named + name: ObjectId + awards: + type: + type: named + name: movies_awards + cast: + type: + type: nullable + underlying_type: + type: array + element_type: + type: named + name: String + countries: + type: + type: array + element_type: + type: named + name: String + directors: + type: + type: array + element_type: + type: named + name: String + fullplot: + type: + type: named + name: String + genres: + type: + type: array + element_type: + type: named + name: String + imdb: + type: + type: named + name: movies_imdb + languages: + type: + type: array + element_type: + type: named + name: String + lastupdated: + type: + type: named + name: String + metacritic: + type: + type: nullable + underlying_type: + type: named + name: Int + num_mflix_comments: + type: + type: nullable + underlying_type: + type: named + name: Int + plot: + type: + type: named + name: String + poster: + type: + type: named + name: String + rated: + type: + type: nullable + underlying_type: + type: named + name: String + released: + type: + type: named + name: Date + runtime: + type: + type: named + name: Int + title: + type: + type: named + name: String + tomatoes: + type: + type: named + name: movies_tomatoes + type: + type: + type: named + name: String + writers: + type: + type: array + element_type: + type: named + name: String + year: + type: + type: named + name: Int + movies_awards: + fields: + nominations: + type: + type: named + name: Int + text: + type: + type: named + name: String + wins: + type: + type: named + name: Int + movies_imdb: + fields: + id: + type: + type: named + name: Int + rating: + type: + type: named + name: Double + votes: + type: + type: named + name: Int + movies_tomatoes: + fields: + boxOffice: + type: + type: nullable + underlying_type: + type: named + name: String + consensus: + type: + type: nullable + underlying_type: + type: named + name: String + critic: + type: + type: nullable + underlying_type: + type: named + name: movies_tomatoes_critic + dvd: + type: + type: nullable + underlying_type: + type: named + name: Date + fresh: + type: + type: nullable + underlying_type: + type: named + name: Int + lastUpdated: + type: + type: named + name: Date + production: + type: + type: nullable + underlying_type: + type: named + name: String + rotten: + type: + type: nullable + underlying_type: + type: named + name: Int + viewer: + type: + type: named + name: movies_tomatoes_viewer + website: + type: + type: nullable + underlying_type: + type: named + name: String + movies_tomatoes_critic: + fields: + meter: + type: + type: nullable + underlying_type: + type: named + name: Int + numReviews: + type: + type: named + name: Int + rating: + type: + type: nullable + underlying_type: + type: named + name: Double + movies_tomatoes_viewer: + fields: + meter: + type: + type: named + name: Int + numReviews: + type: + type: named + name: Int + rating: + type: + type: nullable + underlying_type: + type: named + name: Double + sessions: + fields: + _id: + type: + type: named + name: ObjectId + jwt: + type: + type: named + name: String + user_id: + type: + type: named + name: String + theaters: + fields: + _id: + type: + type: named + name: ObjectId + location: + type: + type: named + name: theaters_location + theaterId: + type: + type: named + name: Int + theaters_location: + fields: + address: + type: + type: named + name: theaters_location_address + geo: + type: + type: named + name: theaters_location_geo + theaters_location_address: + fields: + city: + type: + type: named + name: String + state: + type: + type: named + name: String + street1: + type: + type: named + name: String + street2: + type: + type: nullable + underlying_type: + type: named + name: String + zipcode: + type: + type: named + name: String + theaters_location_geo: + fields: + coordinates: + type: + type: array + element_type: + type: named + name: Double + type: + type: + type: named + name: String + users: + fields: + _id: + type: + type: named + name: ObjectId + email: + type: + type: named + name: String + name: + type: + type: named + name: String + password: + type: + type: named + name: String + collections: + - name: comments + arguments: {} + type: comments + uniqueness_constraints: + comments_id: + unique_columns: + - _id + foreign_keys: {} + - name: movies + arguments: {} + type: movies + uniqueness_constraints: + movies_id: + unique_columns: + - _id + foreign_keys: {} + - name: sessions + arguments: {} + type: sessions + uniqueness_constraints: + sessions_id: + unique_columns: + - _id + foreign_keys: {} + - name: theaters + arguments: {} + type: theaters + uniqueness_constraints: + theaters_id: + unique_columns: + - _id + foreign_keys: {} + - name: title_word_frequency + description: words appearing in movie titles with counts + arguments: {} + type: TitleWordFrequency + uniqueness_constraints: + title_word_frequency_id: + unique_columns: + - _id + foreign_keys: {} + - name: users + arguments: {} + type: users + uniqueness_constraints: + users_id: + unique_columns: + - _id + foreign_keys: {} + functions: + - name: hello + description: Basic test of native queries + arguments: + name: + type: + type: named + name: String + result_type: + type: named + name: String procedures: [] capabilities: - version: "" + version: 0.1.4 capabilities: - query: {} + query: + aggregates: {} + variables: {} + explain: {} mutation: {} + relationships: + relation_comparisons: {} From dfbe449e51ed3e5d882db6bfc43d3cc205f68a40 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Thu, 13 Jun 2024 15:21:35 -0700 Subject: [PATCH 16/34] copy over metadata --- .../hasura/chinook/metadata/commands/.gitkeep | 0 .../metadata/commands/InsertArtist.hml | 61 +++ .../metadata/dataconnectors/chinook-types.hml | 65 +++ .../metadata/{ => dataconnectors}/chinook.hml | 291 ++++------ .../hasura/chinook/metadata/models/Album.hml | 114 ++++ .../hasura/chinook/metadata/models/Artist.hml | 102 ++++ .../chinook/metadata/models/Customer.hml | 234 ++++++++ .../chinook/metadata/models/Employee.hml | 258 +++++++++ .../hasura/chinook/metadata/models/Genre.hml | 102 ++++ .../chinook/metadata/models/Invoice.hml | 186 +++++++ .../chinook/metadata/models/InvoiceLine.hml | 138 +++++ .../chinook/metadata/models/MediaType.hml | 102 ++++ .../chinook/metadata/models/Playlist.hml | 102 ++++ .../chinook/metadata/models/PlaylistTrack.hml | 102 ++++ .../hasura/chinook/metadata/models/Track.hml | 186 +++++++ .../metadata/relationships/album_tracks.hml | 34 ++ .../metadata/relationships/artist_albums.hml | 34 ++ .../relationships/customer_invoices.hml | 34 ++ .../relationships/employee_customers.hml | 34 ++ .../relationships/employee_employees.hml | 34 ++ .../metadata/relationships/genre_tracks.hml | 34 ++ .../metadata/relationships/invoice_lines.hml | 34 ++ .../relationships/media_type_tracks.hml | 34 ++ .../relationships/playlist_tracks.hml | 70 +++ .../relationships/track_invoice_lines.hml | 34 ++ .../sample_mflix/metadata/commands/Hello.hml | 27 + .../dataconnectors/sample_mflix-types.hml | 83 +++ .../{ => dataconnectors}/sample_mflix.hml | 143 ++--- .../sample_mflix/metadata/models/Comments.hml | 157 ++++++ .../sample_mflix/metadata/models/Movies.hml | 511 ++++++++++++++++++ .../sample_mflix/metadata/models/Sessions.hml | 102 ++++ .../sample_mflix/metadata/models/Theaters.hml | 198 +++++++ .../metadata/models/TitleWordFrequency.hml | 90 +++ .../sample_mflix/metadata/models/Users.hml | 127 +++++ .../metadata/relationships/movie_comments.hml | 35 ++ .../metadata/relationships/user_comments.hml | 34 ++ 36 files changed, 3642 insertions(+), 284 deletions(-) create mode 100644 fixtures/hasura/chinook/metadata/commands/.gitkeep create mode 100644 fixtures/hasura/chinook/metadata/commands/InsertArtist.hml create mode 100644 fixtures/hasura/chinook/metadata/dataconnectors/chinook-types.hml rename fixtures/hasura/chinook/metadata/{ => dataconnectors}/chinook.hml (78%) create mode 100644 fixtures/hasura/chinook/metadata/models/Album.hml create mode 100644 fixtures/hasura/chinook/metadata/models/Artist.hml create mode 100644 fixtures/hasura/chinook/metadata/models/Customer.hml create mode 100644 fixtures/hasura/chinook/metadata/models/Employee.hml create mode 100644 fixtures/hasura/chinook/metadata/models/Genre.hml create mode 100644 fixtures/hasura/chinook/metadata/models/Invoice.hml create mode 100644 fixtures/hasura/chinook/metadata/models/InvoiceLine.hml create mode 100644 fixtures/hasura/chinook/metadata/models/MediaType.hml create mode 100644 fixtures/hasura/chinook/metadata/models/Playlist.hml create mode 100644 fixtures/hasura/chinook/metadata/models/PlaylistTrack.hml create mode 100644 fixtures/hasura/chinook/metadata/models/Track.hml create mode 100644 fixtures/hasura/chinook/metadata/relationships/album_tracks.hml create mode 100644 fixtures/hasura/chinook/metadata/relationships/artist_albums.hml create mode 100644 fixtures/hasura/chinook/metadata/relationships/customer_invoices.hml create mode 100644 fixtures/hasura/chinook/metadata/relationships/employee_customers.hml create mode 100644 fixtures/hasura/chinook/metadata/relationships/employee_employees.hml create mode 100644 fixtures/hasura/chinook/metadata/relationships/genre_tracks.hml create mode 100644 fixtures/hasura/chinook/metadata/relationships/invoice_lines.hml create mode 100644 fixtures/hasura/chinook/metadata/relationships/media_type_tracks.hml create mode 100644 fixtures/hasura/chinook/metadata/relationships/playlist_tracks.hml create mode 100644 fixtures/hasura/chinook/metadata/relationships/track_invoice_lines.hml create mode 100644 fixtures/hasura/sample_mflix/metadata/commands/Hello.hml create mode 100644 fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix-types.hml rename fixtures/hasura/sample_mflix/metadata/{ => dataconnectors}/sample_mflix.hml (92%) create mode 100644 fixtures/hasura/sample_mflix/metadata/models/Comments.hml create mode 100644 fixtures/hasura/sample_mflix/metadata/models/Movies.hml create mode 100644 fixtures/hasura/sample_mflix/metadata/models/Sessions.hml create mode 100644 fixtures/hasura/sample_mflix/metadata/models/Theaters.hml create mode 100644 fixtures/hasura/sample_mflix/metadata/models/TitleWordFrequency.hml create mode 100644 fixtures/hasura/sample_mflix/metadata/models/Users.hml create mode 100644 fixtures/hasura/sample_mflix/metadata/relationships/movie_comments.hml create mode 100644 fixtures/hasura/sample_mflix/metadata/relationships/user_comments.hml diff --git a/fixtures/hasura/chinook/metadata/commands/.gitkeep b/fixtures/hasura/chinook/metadata/commands/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/fixtures/hasura/chinook/metadata/commands/InsertArtist.hml b/fixtures/hasura/chinook/metadata/commands/InsertArtist.hml new file mode 100644 index 00000000..9dd323da --- /dev/null +++ b/fixtures/hasura/chinook/metadata/commands/InsertArtist.hml @@ -0,0 +1,61 @@ +kind: Command +version: v1 +definition: + name: insertArtist + description: Example of a database update using a native mutation + outputType: InsertArtist + arguments: + - name: id + type: Int! + - name: name + type: String! + source: + dataConnectorName: chinook + dataConnectorCommand: + procedure: insertArtist + argumentMapping: + id: id + name: name + graphql: + rootFieldName: insertArtist + rootFieldKind: Mutation + +--- +kind: CommandPermissions +version: v1 +definition: + commandName: insertArtist + permissions: + - role: admin + allowExecution: true + +--- +kind: ObjectType +version: v1 +definition: + name: InsertArtist + graphql: + typeName: InsertArtist + 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/dataconnectors/chinook-types.hml b/fixtures/hasura/chinook/metadata/dataconnectors/chinook-types.hml new file mode 100644 index 00000000..8be96015 --- /dev/null +++ b/fixtures/hasura/chinook/metadata/dataconnectors/chinook-types.hml @@ -0,0 +1,65 @@ +--- +kind: ScalarType +version: v1 +definition: + name: Chinook_ObjectId + graphql: + typeName: Chinook_ObjectId + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: chinook + dataConnectorScalarType: ObjectId + representation: Chinook_ObjectId + graphql: + comparisonExpressionTypeName: Chinook_ObjectIdComparisonExp + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: chinook + dataConnectorScalarType: Int + representation: Int + graphql: + comparisonExpressionTypeName: IntComparisonExp + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: chinook + dataConnectorScalarType: String + representation: String + graphql: + comparisonExpressionTypeName: StringComparisonExp + +--- +kind: ScalarType +version: v1 +definition: + name: Chinook_ExtendedJson + graphql: + typeName: Chinook_ExtendedJson + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: chinook + dataConnectorScalarType: ExtendedJSON + representation: Chinook_ExtendedJson + graphql: + comparisonExpressionTypeName: Chinook_ExtendedJsonComparisonExp + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: chinook + dataConnectorScalarType: Float + representation: Float + graphql: + comparisonExpressionTypeName: FloatComparisonExp diff --git a/fixtures/hasura/chinook/metadata/chinook.hml b/fixtures/hasura/chinook/metadata/dataconnectors/chinook.hml similarity index 78% rename from fixtures/hasura/chinook/metadata/chinook.hml rename to fixtures/hasura/chinook/metadata/dataconnectors/chinook.hml index 487f72a4..5f65ea10 100644 --- a/fixtures/hasura/chinook/metadata/chinook.hml +++ b/fixtures/hasura/chinook/metadata/dataconnectors/chinook.hml @@ -26,9 +26,7 @@ definition: argument_type: type: named name: BinData - Bool: - representation: - type: boolean + Boolean: aggregate_functions: count: result_type: @@ -41,10 +39,8 @@ definition: type: custom argument_type: type: named - name: Bool + name: Boolean Date: - representation: - type: timestamp aggregate_functions: count: result_type: @@ -101,8 +97,6 @@ definition: type: named name: DbPointer Decimal: - representation: - type: bigdecimal aggregate_functions: avg: result_type: @@ -152,14 +146,15 @@ definition: argument_type: type: named name: Decimal - Double: - representation: - type: float64 + ExtendedJSON: + aggregate_functions: {} + comparison_operators: {} + Float: aggregate_functions: avg: result_type: type: named - name: Double + name: Float count: result_type: type: named @@ -167,15 +162,15 @@ definition: max: result_type: type: named - name: Double + name: Float min: result_type: type: named - name: Double + name: Float sum: result_type: type: named - name: Double + name: Float comparison_operators: _eq: type: equal @@ -183,35 +178,28 @@ definition: type: custom argument_type: type: named - name: Double + name: Float _gte: type: custom argument_type: type: named - name: Double + name: Float _lt: type: custom argument_type: type: named - name: Double + name: Float _lte: type: custom argument_type: type: named - name: Double + name: Float _neq: type: custom argument_type: type: named - name: Double - ExtendedJSON: - representation: - type: json - aggregate_functions: {} - comparison_operators: {} + name: Float Int: - representation: - type: int32 aggregate_functions: avg: result_type: @@ -276,8 +264,6 @@ definition: name: Int comparison_operators: {} Long: - representation: - type: int64 aggregate_functions: avg: result_type: @@ -370,8 +356,6 @@ definition: type: named name: "Null" ObjectId: - representation: - type: string aggregate_functions: count: result_type: @@ -393,8 +377,6 @@ definition: name: Int comparison_operators: {} String: - representation: - type: string aggregate_functions: count: result_type: @@ -518,7 +500,6 @@ definition: name: Undefined object_types: Album: - description: Object type for collection Album fields: _id: type: @@ -537,7 +518,6 @@ definition: type: named name: String Artist: - description: Object type for collection Artist fields: _id: type: @@ -549,12 +529,9 @@ definition: name: Int Name: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String Customer: - description: Object type for collection Customer fields: _id: type: @@ -562,28 +539,20 @@ 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 - underlying_type: - type: named - name: String + type: named + name: String Country: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String CustomerId: type: type: named @@ -594,10 +563,8 @@ definition: name: String Fax: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String FirstName: type: type: named @@ -608,30 +575,23 @@ definition: 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 + name: ExtendedJSON State: type: - type: nullable - underlying_type: - type: named - name: String + type: named + 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: @@ -639,70 +599,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 @@ -711,18 +653,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: @@ -733,23 +670,10 @@ definition: type: named name: Int Name: - type: - type: nullable - underlying_type: - type: named - name: String - InsertArtist: - fields: - "n": - type: - type: named - name: Int - ok: type: type: named - name: Double + name: String Invoice: - description: Object type for collection Invoice fields: _id: type: @@ -757,34 +681,26 @@ 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 underlying_type: type: named - name: String + name: ExtendedJSON BillingState: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String CustomerId: type: type: named @@ -800,9 +716,8 @@ definition: Total: type: type: named - name: Decimal + name: Float InvoiceLine: - description: Object type for collection InvoiceLine fields: _id: type: @@ -827,9 +742,8 @@ definition: UnitPrice: type: type: named - name: Decimal + name: Float MediaType: - description: Object type for collection MediaType fields: _id: type: @@ -841,12 +755,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: @@ -854,16 +765,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: @@ -878,7 +786,6 @@ definition: type: named name: Int Track: - description: Object type for collection Track fields: _id: type: @@ -886,28 +793,20 @@ 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 - underlying_type: - type: named - name: String + type: named + name: String GenreId: type: - type: nullable - underlying_type: - type: named - name: Int + type: named + name: Int MediaTypeId: type: type: named @@ -927,7 +826,13 @@ definition: UnitPrice: type: type: named - name: Decimal + name: Float + InsertArtist: + fields: + ok: + type: { type: named, name: Double } + n: + type: { type: named, name: Int } collections: - name: Album arguments: {} @@ -1020,26 +925,18 @@ definition: functions: [] procedures: - name: insertArtist - description: Example of a database update using a native mutation + description: Example of a database update using a native procedure + result_type: { type: named, name: InsertArtist } arguments: - id: - type: - type: named - name: Int - name: - type: - type: named - name: String - result_type: - type: named - name: InsertArtist + id: { type: { type: named, name: Int } } + name: { type: { type: named, name: String } } capabilities: - version: 0.1.4 + version: 0.1.1 capabilities: query: aggregates: {} variables: {} explain: {} mutation: {} - relationships: - relation_comparisons: {} + relationships: {} + diff --git a/fixtures/hasura/chinook/metadata/models/Album.hml b/fixtures/hasura/chinook/metadata/models/Album.hml new file mode 100644 index 00000000..a17cf54c --- /dev/null +++ b/fixtures/hasura/chinook/metadata/models/Album.hml @@ -0,0 +1,114 @@ +--- +kind: ObjectType +version: v1 +definition: + name: Album + fields: + - name: id + type: Chinook_ObjectId! + - name: albumId + type: Int! + - name: artistId + type: Int! + - name: title + type: String! + graphql: + typeName: Album + inputTypeName: AlbumInput + dataConnectorTypeMapping: + - dataConnectorName: chinook + dataConnectorObjectType: Album + fieldMapping: + id: + column: + name: _id + albumId: + column: + name: AlbumId + artistId: + column: + name: ArtistId + title: + column: + name: Title + +--- +kind: TypePermissions +version: v1 +definition: + typeName: Album + permissions: + - role: admin + output: + allowedFields: + - id + - albumId + - artistId + - title + +--- +kind: ObjectBooleanExpressionType +version: v1 +definition: + name: AlbumBoolExp + objectType: Album + dataConnectorName: chinook + dataConnectorObjectType: Album + comparableFields: + - fieldName: id + operators: + enableAll: true + - fieldName: albumId + operators: + enableAll: true + - fieldName: artistId + operators: + enableAll: true + - fieldName: title + operators: + enableAll: true + graphql: + typeName: AlbumBoolExp + +--- +kind: Model +version: v1 +definition: + name: Album + objectType: Album + source: + dataConnectorName: chinook + collection: Album + filterExpressionType: AlbumBoolExp + orderableFields: + - fieldName: id + orderByDirections: + enableAll: true + - fieldName: albumId + orderByDirections: + enableAll: true + - fieldName: artistId + orderByDirections: + enableAll: true + - fieldName: title + orderByDirections: + enableAll: true + graphql: + selectMany: + queryRootField: album + selectUniques: + - queryRootField: albumById + uniqueIdentifier: + - id + orderByExpressionType: AlbumOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: Album + permissions: + - role: admin + select: + filter: null + diff --git a/fixtures/hasura/chinook/metadata/models/Artist.hml b/fixtures/hasura/chinook/metadata/models/Artist.hml new file mode 100644 index 00000000..b88dccf6 --- /dev/null +++ b/fixtures/hasura/chinook/metadata/models/Artist.hml @@ -0,0 +1,102 @@ +--- +kind: ObjectType +version: v1 +definition: + name: Artist + fields: + - name: id + type: Chinook_ObjectId! + - name: artistId + type: Int! + - name: name + type: String! + graphql: + typeName: Artist + inputTypeName: ArtistInput + dataConnectorTypeMapping: + - dataConnectorName: chinook + dataConnectorObjectType: Artist + fieldMapping: + id: + column: + name: _id + artistId: + column: + name: ArtistId + name: + column: + name: Name + +--- +kind: TypePermissions +version: v1 +definition: + typeName: Artist + permissions: + - role: admin + output: + allowedFields: + - id + - artistId + - name + +--- +kind: ObjectBooleanExpressionType +version: v1 +definition: + name: ArtistBoolExp + objectType: Artist + dataConnectorName: chinook + dataConnectorObjectType: Artist + comparableFields: + - fieldName: id + operators: + enableAll: true + - fieldName: artistId + operators: + enableAll: true + - fieldName: name + operators: + enableAll: true + graphql: + typeName: ArtistBoolExp + +--- +kind: Model +version: v1 +definition: + name: Artist + objectType: Artist + source: + dataConnectorName: chinook + collection: Artist + filterExpressionType: ArtistBoolExp + orderableFields: + - fieldName: id + orderByDirections: + enableAll: true + - fieldName: artistId + orderByDirections: + enableAll: true + - fieldName: name + orderByDirections: + enableAll: true + graphql: + selectMany: + queryRootField: artist + selectUniques: + - queryRootField: artistById + uniqueIdentifier: + - id + orderByExpressionType: ArtistOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: Artist + permissions: + - role: admin + select: + filter: null + diff --git a/fixtures/hasura/chinook/metadata/models/Customer.hml b/fixtures/hasura/chinook/metadata/models/Customer.hml new file mode 100644 index 00000000..a579f1ca --- /dev/null +++ b/fixtures/hasura/chinook/metadata/models/Customer.hml @@ -0,0 +1,234 @@ +--- +kind: ObjectType +version: v1 +definition: + name: Customer + fields: + - name: id + type: Chinook_ObjectId! + - name: address + type: String! + - name: city + type: String! + - name: company + type: String! + - name: country + type: String! + - name: customerId + type: Int! + - name: email + type: String! + - name: fax + type: String! + - name: firstName + type: String! + - name: lastName + type: String! + - name: phone + type: String! + - name: postalCode + type: Chinook_ExtendedJson + - name: state + type: String! + - name: supportRepId + type: Int! + graphql: + typeName: Customer + inputTypeName: CustomerInput + dataConnectorTypeMapping: + - dataConnectorName: chinook + dataConnectorObjectType: Customer + fieldMapping: + id: + column: + name: _id + address: + column: + name: Address + city: + column: + name: City + company: + column: + name: Company + country: + column: + name: Country + customerId: + column: + name: CustomerId + email: + column: + name: Email + fax: + column: + name: Fax + firstName: + column: + name: FirstName + lastName: + column: + name: LastName + phone: + column: + name: Phone + postalCode: + column: + name: PostalCode + state: + column: + name: State + supportRepId: + column: + name: SupportRepId + +--- +kind: TypePermissions +version: v1 +definition: + typeName: Customer + permissions: + - role: admin + output: + allowedFields: + - id + - address + - city + - company + - country + - customerId + - email + - fax + - firstName + - lastName + - phone + - postalCode + - state + - supportRepId + +--- +kind: ObjectBooleanExpressionType +version: v1 +definition: + name: CustomerBoolExp + objectType: Customer + dataConnectorName: chinook + dataConnectorObjectType: Customer + comparableFields: + - fieldName: id + operators: + enableAll: true + - fieldName: address + operators: + enableAll: true + - fieldName: city + operators: + enableAll: true + - fieldName: company + operators: + enableAll: true + - fieldName: country + operators: + enableAll: true + - fieldName: customerId + operators: + enableAll: true + - fieldName: email + operators: + enableAll: true + - fieldName: fax + operators: + enableAll: true + - fieldName: firstName + operators: + enableAll: true + - fieldName: lastName + operators: + enableAll: true + - fieldName: phone + operators: + enableAll: true + - fieldName: postalCode + operators: + enableAll: true + - fieldName: state + operators: + enableAll: true + - fieldName: supportRepId + operators: + enableAll: true + graphql: + typeName: CustomerBoolExp + +--- +kind: Model +version: v1 +definition: + name: Customer + objectType: Customer + source: + dataConnectorName: chinook + collection: Customer + filterExpressionType: CustomerBoolExp + orderableFields: + - fieldName: id + orderByDirections: + enableAll: true + - fieldName: address + orderByDirections: + enableAll: true + - fieldName: city + orderByDirections: + enableAll: true + - fieldName: company + orderByDirections: + enableAll: true + - fieldName: country + orderByDirections: + enableAll: true + - fieldName: customerId + orderByDirections: + enableAll: true + - fieldName: email + orderByDirections: + enableAll: true + - fieldName: fax + orderByDirections: + enableAll: true + - fieldName: firstName + orderByDirections: + enableAll: true + - fieldName: lastName + orderByDirections: + enableAll: true + - fieldName: phone + orderByDirections: + enableAll: true + - fieldName: postalCode + orderByDirections: + enableAll: true + - fieldName: state + orderByDirections: + enableAll: true + - fieldName: supportRepId + orderByDirections: + enableAll: true + graphql: + selectMany: + queryRootField: customer + selectUniques: + - queryRootField: customerById + uniqueIdentifier: + - id + orderByExpressionType: CustomerOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: Customer + permissions: + - role: admin + select: + filter: null + diff --git a/fixtures/hasura/chinook/metadata/models/Employee.hml b/fixtures/hasura/chinook/metadata/models/Employee.hml new file mode 100644 index 00000000..5615c097 --- /dev/null +++ b/fixtures/hasura/chinook/metadata/models/Employee.hml @@ -0,0 +1,258 @@ +--- +kind: ObjectType +version: v1 +definition: + name: Employee + fields: + - name: id + type: Chinook_ObjectId! + - name: address + type: String! + - name: birthDate + type: String! + - name: city + type: String! + - name: country + type: String! + - name: email + type: String! + - name: employeeId + type: Int! + - name: fax + type: String! + - name: firstName + type: String! + - name: hireDate + type: String! + - name: lastName + type: String! + - name: phone + type: String! + - name: postalCode + type: String! + - name: reportsTo + type: Int + - name: state + type: String! + - name: title + type: String! + graphql: + typeName: Employee + inputTypeName: EmployeeInput + dataConnectorTypeMapping: + - dataConnectorName: chinook + dataConnectorObjectType: Employee + fieldMapping: + id: + column: + name: _id + address: + column: + name: Address + birthDate: + column: + name: BirthDate + city: + column: + name: City + country: + column: + name: Country + email: + column: + name: Email + employeeId: + column: + name: EmployeeId + fax: + column: + name: Fax + firstName: + column: + name: FirstName + hireDate: + column: + name: HireDate + lastName: + column: + name: LastName + phone: + column: + name: Phone + postalCode: + column: + name: PostalCode + reportsTo: + column: + name: ReportsTo + state: + column: + name: State + title: + column: + name: Title + +--- +kind: TypePermissions +version: v1 +definition: + typeName: Employee + permissions: + - role: admin + output: + allowedFields: + - id + - address + - birthDate + - city + - country + - email + - employeeId + - fax + - firstName + - hireDate + - lastName + - phone + - postalCode + - reportsTo + - state + - title + +--- +kind: ObjectBooleanExpressionType +version: v1 +definition: + name: EmployeeBoolExp + objectType: Employee + dataConnectorName: chinook + dataConnectorObjectType: Employee + comparableFields: + - fieldName: id + operators: + enableAll: true + - fieldName: address + operators: + enableAll: true + - fieldName: birthDate + operators: + enableAll: true + - fieldName: city + operators: + enableAll: true + - fieldName: country + operators: + enableAll: true + - fieldName: email + operators: + enableAll: true + - fieldName: employeeId + operators: + enableAll: true + - fieldName: fax + operators: + enableAll: true + - fieldName: firstName + operators: + enableAll: true + - fieldName: hireDate + operators: + enableAll: true + - fieldName: lastName + operators: + enableAll: true + - fieldName: phone + operators: + enableAll: true + - fieldName: postalCode + operators: + enableAll: true + - fieldName: reportsTo + operators: + enableAll: true + - fieldName: state + operators: + enableAll: true + - fieldName: title + operators: + enableAll: true + graphql: + typeName: EmployeeBoolExp + +--- +kind: Model +version: v1 +definition: + name: Employee + objectType: Employee + source: + dataConnectorName: chinook + collection: Employee + filterExpressionType: EmployeeBoolExp + orderableFields: + - fieldName: id + orderByDirections: + enableAll: true + - fieldName: address + orderByDirections: + enableAll: true + - fieldName: birthDate + orderByDirections: + enableAll: true + - fieldName: city + orderByDirections: + enableAll: true + - fieldName: country + orderByDirections: + enableAll: true + - fieldName: email + orderByDirections: + enableAll: true + - fieldName: employeeId + orderByDirections: + enableAll: true + - fieldName: fax + orderByDirections: + enableAll: true + - fieldName: firstName + orderByDirections: + enableAll: true + - fieldName: hireDate + orderByDirections: + enableAll: true + - fieldName: lastName + orderByDirections: + enableAll: true + - fieldName: phone + orderByDirections: + enableAll: true + - fieldName: postalCode + orderByDirections: + enableAll: true + - fieldName: reportsTo + orderByDirections: + enableAll: true + - fieldName: state + orderByDirections: + enableAll: true + - fieldName: title + orderByDirections: + enableAll: true + graphql: + selectMany: + queryRootField: employee + selectUniques: + - queryRootField: employeeById + uniqueIdentifier: + - id + orderByExpressionType: EmployeeOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: Employee + permissions: + - role: admin + select: + filter: null + diff --git a/fixtures/hasura/chinook/metadata/models/Genre.hml b/fixtures/hasura/chinook/metadata/models/Genre.hml new file mode 100644 index 00000000..916ab2e1 --- /dev/null +++ b/fixtures/hasura/chinook/metadata/models/Genre.hml @@ -0,0 +1,102 @@ +--- +kind: ObjectType +version: v1 +definition: + name: Genre + fields: + - name: id + type: Chinook_ObjectId! + - name: genreId + type: Int! + - name: name + type: String! + graphql: + typeName: Genre + inputTypeName: GenreInput + dataConnectorTypeMapping: + - dataConnectorName: chinook + dataConnectorObjectType: Genre + fieldMapping: + id: + column: + name: _id + genreId: + column: + name: GenreId + name: + column: + name: Name + +--- +kind: TypePermissions +version: v1 +definition: + typeName: Genre + permissions: + - role: admin + output: + allowedFields: + - id + - genreId + - name + +--- +kind: ObjectBooleanExpressionType +version: v1 +definition: + name: GenreBoolExp + objectType: Genre + dataConnectorName: chinook + dataConnectorObjectType: Genre + comparableFields: + - fieldName: id + operators: + enableAll: true + - fieldName: genreId + operators: + enableAll: true + - fieldName: name + operators: + enableAll: true + graphql: + typeName: GenreBoolExp + +--- +kind: Model +version: v1 +definition: + name: Genre + objectType: Genre + source: + dataConnectorName: chinook + collection: Genre + filterExpressionType: GenreBoolExp + orderableFields: + - fieldName: id + orderByDirections: + enableAll: true + - fieldName: genreId + orderByDirections: + enableAll: true + - fieldName: name + orderByDirections: + enableAll: true + graphql: + selectMany: + queryRootField: genre + selectUniques: + - queryRootField: genreById + uniqueIdentifier: + - id + orderByExpressionType: GenreOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: Genre + permissions: + - role: admin + select: + filter: null + diff --git a/fixtures/hasura/chinook/metadata/models/Invoice.hml b/fixtures/hasura/chinook/metadata/models/Invoice.hml new file mode 100644 index 00000000..50b6558d --- /dev/null +++ b/fixtures/hasura/chinook/metadata/models/Invoice.hml @@ -0,0 +1,186 @@ +--- +kind: ObjectType +version: v1 +definition: + name: Invoice + fields: + - name: id + type: Chinook_ObjectId! + - name: billingAddress + type: String! + - name: billingCity + type: String! + - name: billingCountry + type: String! + - name: billingPostalCode + type: Chinook_ExtendedJson + - name: billingState + type: String! + - name: customerId + type: Int! + - name: invoiceDate + type: String! + - name: invoiceId + type: Int! + - name: total + type: Float! + graphql: + typeName: Invoice + inputTypeName: InvoiceInput + dataConnectorTypeMapping: + - dataConnectorName: chinook + dataConnectorObjectType: Invoice + fieldMapping: + id: + column: + name: _id + billingAddress: + column: + name: BillingAddress + billingCity: + column: + name: BillingCity + billingCountry: + column: + name: BillingCountry + billingPostalCode: + column: + name: BillingPostalCode + billingState: + column: + name: BillingState + customerId: + column: + name: CustomerId + invoiceDate: + column: + name: InvoiceDate + invoiceId: + column: + name: InvoiceId + total: + column: + name: Total + +--- +kind: TypePermissions +version: v1 +definition: + typeName: Invoice + permissions: + - role: admin + output: + allowedFields: + - id + - billingAddress + - billingCity + - billingCountry + - billingPostalCode + - billingState + - customerId + - invoiceDate + - invoiceId + - total + +--- +kind: ObjectBooleanExpressionType +version: v1 +definition: + name: InvoiceBoolExp + objectType: Invoice + dataConnectorName: chinook + dataConnectorObjectType: Invoice + comparableFields: + - fieldName: id + operators: + enableAll: true + - fieldName: billingAddress + operators: + enableAll: true + - fieldName: billingCity + operators: + enableAll: true + - fieldName: billingCountry + operators: + enableAll: true + - fieldName: billingPostalCode + operators: + enableAll: true + - fieldName: billingState + operators: + enableAll: true + - fieldName: customerId + operators: + enableAll: true + - fieldName: invoiceDate + operators: + enableAll: true + - fieldName: invoiceId + operators: + enableAll: true + - fieldName: total + operators: + enableAll: true + graphql: + typeName: InvoiceBoolExp + +--- +kind: Model +version: v1 +definition: + name: Invoice + objectType: Invoice + source: + dataConnectorName: chinook + collection: Invoice + filterExpressionType: InvoiceBoolExp + orderableFields: + - fieldName: id + orderByDirections: + enableAll: true + - fieldName: billingAddress + orderByDirections: + enableAll: true + - fieldName: billingCity + orderByDirections: + enableAll: true + - fieldName: billingCountry + orderByDirections: + enableAll: true + - fieldName: billingPostalCode + orderByDirections: + enableAll: true + - fieldName: billingState + orderByDirections: + enableAll: true + - fieldName: customerId + orderByDirections: + enableAll: true + - fieldName: invoiceDate + orderByDirections: + enableAll: true + - fieldName: invoiceId + orderByDirections: + enableAll: true + - fieldName: total + orderByDirections: + enableAll: true + graphql: + selectMany: + queryRootField: invoice + selectUniques: + - queryRootField: invoiceById + uniqueIdentifier: + - id + orderByExpressionType: InvoiceOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: Invoice + permissions: + - role: admin + select: + filter: null + diff --git a/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml b/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml new file mode 100644 index 00000000..39513adc --- /dev/null +++ b/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml @@ -0,0 +1,138 @@ +--- +kind: ObjectType +version: v1 +definition: + name: InvoiceLine + fields: + - name: id + type: Chinook_ObjectId! + - name: invoiceId + type: Int! + - name: invoiceLineId + type: Int! + - name: quantity + type: Int! + - name: trackId + type: Int! + - name: unitPrice + type: Float! + graphql: + typeName: InvoiceLine + inputTypeName: InvoiceLineInput + dataConnectorTypeMapping: + - dataConnectorName: chinook + dataConnectorObjectType: InvoiceLine + fieldMapping: + id: + column: + name: _id + invoiceId: + column: + name: InvoiceId + invoiceLineId: + column: + name: InvoiceLineId + quantity: + column: + name: Quantity + trackId: + column: + name: TrackId + unitPrice: + column: + name: UnitPrice + +--- +kind: TypePermissions +version: v1 +definition: + typeName: InvoiceLine + permissions: + - role: admin + output: + allowedFields: + - id + - invoiceId + - invoiceLineId + - quantity + - trackId + - unitPrice + +--- +kind: ObjectBooleanExpressionType +version: v1 +definition: + name: InvoiceLineBoolExp + objectType: InvoiceLine + dataConnectorName: chinook + dataConnectorObjectType: InvoiceLine + comparableFields: + - fieldName: id + operators: + enableAll: true + - fieldName: invoiceId + operators: + enableAll: true + - fieldName: invoiceLineId + operators: + enableAll: true + - fieldName: quantity + operators: + enableAll: true + - fieldName: trackId + operators: + enableAll: true + - fieldName: unitPrice + operators: + enableAll: true + graphql: + typeName: InvoiceLineBoolExp + +--- +kind: Model +version: v1 +definition: + name: InvoiceLine + objectType: InvoiceLine + source: + dataConnectorName: chinook + collection: InvoiceLine + filterExpressionType: InvoiceLineBoolExp + orderableFields: + - fieldName: id + orderByDirections: + enableAll: true + - fieldName: invoiceId + orderByDirections: + enableAll: true + - fieldName: invoiceLineId + orderByDirections: + enableAll: true + - fieldName: quantity + orderByDirections: + enableAll: true + - fieldName: trackId + orderByDirections: + enableAll: true + - fieldName: unitPrice + orderByDirections: + enableAll: true + graphql: + selectMany: + queryRootField: invoiceLine + selectUniques: + - queryRootField: invoiceLineById + uniqueIdentifier: + - id + orderByExpressionType: InvoiceLineOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: InvoiceLine + permissions: + - role: admin + select: + filter: null + diff --git a/fixtures/hasura/chinook/metadata/models/MediaType.hml b/fixtures/hasura/chinook/metadata/models/MediaType.hml new file mode 100644 index 00000000..e01e6657 --- /dev/null +++ b/fixtures/hasura/chinook/metadata/models/MediaType.hml @@ -0,0 +1,102 @@ +--- +kind: ObjectType +version: v1 +definition: + name: MediaType + fields: + - name: id + type: Chinook_ObjectId! + - name: mediaTypeId + type: Int! + - name: name + type: String! + graphql: + typeName: MediaType + inputTypeName: MediaTypeInput + dataConnectorTypeMapping: + - dataConnectorName: chinook + dataConnectorObjectType: MediaType + fieldMapping: + id: + column: + name: _id + mediaTypeId: + column: + name: MediaTypeId + name: + column: + name: Name + +--- +kind: TypePermissions +version: v1 +definition: + typeName: MediaType + permissions: + - role: admin + output: + allowedFields: + - id + - mediaTypeId + - name + +--- +kind: ObjectBooleanExpressionType +version: v1 +definition: + name: MediaTypeBoolExp + objectType: MediaType + dataConnectorName: chinook + dataConnectorObjectType: MediaType + comparableFields: + - fieldName: id + operators: + enableAll: true + - fieldName: mediaTypeId + operators: + enableAll: true + - fieldName: name + operators: + enableAll: true + graphql: + typeName: MediaTypeBoolExp + +--- +kind: Model +version: v1 +definition: + name: MediaType + objectType: MediaType + source: + dataConnectorName: chinook + collection: MediaType + filterExpressionType: MediaTypeBoolExp + orderableFields: + - fieldName: id + orderByDirections: + enableAll: true + - fieldName: mediaTypeId + orderByDirections: + enableAll: true + - fieldName: name + orderByDirections: + enableAll: true + graphql: + selectMany: + queryRootField: mediaType + selectUniques: + - queryRootField: mediaTypeById + uniqueIdentifier: + - id + orderByExpressionType: MediaTypeOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: MediaType + permissions: + - role: admin + select: + filter: null + diff --git a/fixtures/hasura/chinook/metadata/models/Playlist.hml b/fixtures/hasura/chinook/metadata/models/Playlist.hml new file mode 100644 index 00000000..6479bbe4 --- /dev/null +++ b/fixtures/hasura/chinook/metadata/models/Playlist.hml @@ -0,0 +1,102 @@ +--- +kind: ObjectType +version: v1 +definition: + name: Playlist + fields: + - name: id + type: Chinook_ObjectId! + - name: name + type: String! + - name: playlistId + type: Int! + graphql: + typeName: Playlist + inputTypeName: PlaylistInput + dataConnectorTypeMapping: + - dataConnectorName: chinook + dataConnectorObjectType: Playlist + fieldMapping: + id: + column: + name: _id + name: + column: + name: Name + playlistId: + column: + name: PlaylistId + +--- +kind: TypePermissions +version: v1 +definition: + typeName: Playlist + permissions: + - role: admin + output: + allowedFields: + - id + - name + - playlistId + +--- +kind: ObjectBooleanExpressionType +version: v1 +definition: + name: PlaylistBoolExp + objectType: Playlist + dataConnectorName: chinook + dataConnectorObjectType: Playlist + comparableFields: + - fieldName: id + operators: + enableAll: true + - fieldName: name + operators: + enableAll: true + - fieldName: playlistId + operators: + enableAll: true + graphql: + typeName: PlaylistBoolExp + +--- +kind: Model +version: v1 +definition: + name: Playlist + objectType: Playlist + source: + dataConnectorName: chinook + collection: Playlist + filterExpressionType: PlaylistBoolExp + orderableFields: + - fieldName: id + orderByDirections: + enableAll: true + - fieldName: name + orderByDirections: + enableAll: true + - fieldName: playlistId + orderByDirections: + enableAll: true + graphql: + selectMany: + queryRootField: playlist + selectUniques: + - queryRootField: playlistById + uniqueIdentifier: + - id + orderByExpressionType: PlaylistOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: Playlist + permissions: + - role: admin + select: + filter: null + diff --git a/fixtures/hasura/chinook/metadata/models/PlaylistTrack.hml b/fixtures/hasura/chinook/metadata/models/PlaylistTrack.hml new file mode 100644 index 00000000..1ce858c7 --- /dev/null +++ b/fixtures/hasura/chinook/metadata/models/PlaylistTrack.hml @@ -0,0 +1,102 @@ +--- +kind: ObjectType +version: v1 +definition: + name: PlaylistTrack + fields: + - name: id + type: Chinook_ObjectId! + - name: playlistId + type: Int! + - name: trackId + type: Int! + graphql: + typeName: PlaylistTrack + inputTypeName: PlaylistTrackInput + dataConnectorTypeMapping: + - dataConnectorName: chinook + dataConnectorObjectType: PlaylistTrack + fieldMapping: + id: + column: + name: _id + playlistId: + column: + name: PlaylistId + trackId: + column: + name: TrackId + +--- +kind: TypePermissions +version: v1 +definition: + typeName: PlaylistTrack + permissions: + - role: admin + output: + allowedFields: + - id + - playlistId + - trackId + +--- +kind: ObjectBooleanExpressionType +version: v1 +definition: + name: PlaylistTrackBoolExp + objectType: PlaylistTrack + dataConnectorName: chinook + dataConnectorObjectType: PlaylistTrack + comparableFields: + - fieldName: id + operators: + enableAll: true + - fieldName: playlistId + operators: + enableAll: true + - fieldName: trackId + operators: + enableAll: true + graphql: + typeName: PlaylistTrackBoolExp + +--- +kind: Model +version: v1 +definition: + name: PlaylistTrack + objectType: PlaylistTrack + source: + dataConnectorName: chinook + collection: PlaylistTrack + filterExpressionType: PlaylistTrackBoolExp + orderableFields: + - fieldName: id + orderByDirections: + enableAll: true + - fieldName: playlistId + orderByDirections: + enableAll: true + - fieldName: trackId + orderByDirections: + enableAll: true + graphql: + selectMany: + queryRootField: playlistTrack + selectUniques: + - queryRootField: playlistTrackById + uniqueIdentifier: + - id + orderByExpressionType: PlaylistTrackOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: PlaylistTrack + permissions: + - role: admin + select: + filter: null + diff --git a/fixtures/hasura/chinook/metadata/models/Track.hml b/fixtures/hasura/chinook/metadata/models/Track.hml new file mode 100644 index 00000000..83c8a7ae --- /dev/null +++ b/fixtures/hasura/chinook/metadata/models/Track.hml @@ -0,0 +1,186 @@ +--- +kind: ObjectType +version: v1 +definition: + name: Track + fields: + - name: id + type: Chinook_ObjectId! + - name: albumId + type: Int! + - name: bytes + type: Int! + - name: composer + type: String! + - name: genreId + type: Int! + - name: mediaTypeId + type: Int! + - name: milliseconds + type: Int! + - name: name + type: String! + - name: trackId + type: Int! + - name: unitPrice + type: Float! + graphql: + typeName: Track + inputTypeName: TrackInput + dataConnectorTypeMapping: + - dataConnectorName: chinook + dataConnectorObjectType: Track + fieldMapping: + id: + column: + name: _id + albumId: + column: + name: AlbumId + bytes: + column: + name: Bytes + composer: + column: + name: Composer + genreId: + column: + name: GenreId + mediaTypeId: + column: + name: MediaTypeId + milliseconds: + column: + name: Milliseconds + name: + column: + name: Name + trackId: + column: + name: TrackId + unitPrice: + column: + name: UnitPrice + +--- +kind: TypePermissions +version: v1 +definition: + typeName: Track + permissions: + - role: admin + output: + allowedFields: + - id + - albumId + - bytes + - composer + - genreId + - mediaTypeId + - milliseconds + - name + - trackId + - unitPrice + +--- +kind: ObjectBooleanExpressionType +version: v1 +definition: + name: TrackBoolExp + objectType: Track + dataConnectorName: chinook + dataConnectorObjectType: Track + comparableFields: + - fieldName: id + operators: + enableAll: true + - fieldName: albumId + operators: + enableAll: true + - fieldName: bytes + operators: + enableAll: true + - fieldName: composer + operators: + enableAll: true + - fieldName: genreId + operators: + enableAll: true + - fieldName: mediaTypeId + operators: + enableAll: true + - fieldName: milliseconds + operators: + enableAll: true + - fieldName: name + operators: + enableAll: true + - fieldName: trackId + operators: + enableAll: true + - fieldName: unitPrice + operators: + enableAll: true + graphql: + typeName: TrackBoolExp + +--- +kind: Model +version: v1 +definition: + name: Track + objectType: Track + source: + dataConnectorName: chinook + collection: Track + filterExpressionType: TrackBoolExp + orderableFields: + - fieldName: id + orderByDirections: + enableAll: true + - fieldName: albumId + orderByDirections: + enableAll: true + - fieldName: bytes + orderByDirections: + enableAll: true + - fieldName: composer + orderByDirections: + enableAll: true + - fieldName: genreId + orderByDirections: + enableAll: true + - fieldName: mediaTypeId + orderByDirections: + enableAll: true + - fieldName: milliseconds + orderByDirections: + enableAll: true + - fieldName: name + orderByDirections: + enableAll: true + - fieldName: trackId + orderByDirections: + enableAll: true + - fieldName: unitPrice + orderByDirections: + enableAll: true + graphql: + selectMany: + queryRootField: track + selectUniques: + - queryRootField: trackById + uniqueIdentifier: + - id + orderByExpressionType: TrackOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: Track + permissions: + - role: admin + select: + filter: null + diff --git a/fixtures/hasura/chinook/metadata/relationships/album_tracks.hml b/fixtures/hasura/chinook/metadata/relationships/album_tracks.hml new file mode 100644 index 00000000..6bb61b4b --- /dev/null +++ b/fixtures/hasura/chinook/metadata/relationships/album_tracks.hml @@ -0,0 +1,34 @@ +kind: Relationship +version: v1 +definition: + name: tracks + source: Album + target: + model: + name: Track + relationshipType: Array + mapping: + - source: + fieldPath: + - fieldName: albumId + target: + modelField: + - fieldName: albumId + +--- +kind: Relationship +version: v1 +definition: + name: album + source: Track + target: + model: + name: Album + relationshipType: Object + mapping: + - source: + fieldPath: + - fieldName: albumId + target: + modelField: + - fieldName: albumId diff --git a/fixtures/hasura/chinook/metadata/relationships/artist_albums.hml b/fixtures/hasura/chinook/metadata/relationships/artist_albums.hml new file mode 100644 index 00000000..5d9890b5 --- /dev/null +++ b/fixtures/hasura/chinook/metadata/relationships/artist_albums.hml @@ -0,0 +1,34 @@ +kind: Relationship +version: v1 +definition: + name: artist + source: Album + target: + model: + name: Artist + relationshipType: Object + mapping: + - source: + fieldPath: + - fieldName: artistId + target: + modelField: + - fieldName: artistId + +--- +kind: Relationship +version: v1 +definition: + name: albums + source: Artist + target: + model: + name: Album + relationshipType: Array + mapping: + - source: + fieldPath: + - fieldName: artistId + target: + modelField: + - fieldName: artistId diff --git a/fixtures/hasura/chinook/metadata/relationships/customer_invoices.hml b/fixtures/hasura/chinook/metadata/relationships/customer_invoices.hml new file mode 100644 index 00000000..8c744bbe --- /dev/null +++ b/fixtures/hasura/chinook/metadata/relationships/customer_invoices.hml @@ -0,0 +1,34 @@ +kind: Relationship +version: v1 +definition: + name: invoices + source: Customer + target: + model: + name: Invoice + relationshipType: Array + mapping: + - source: + fieldPath: + - fieldName: customerId + target: + modelField: + - fieldName: customerId + +--- +kind: Relationship +version: v1 +definition: + name: customer + source: Invoice + target: + model: + name: Customer + relationshipType: Object + mapping: + - source: + fieldPath: + - fieldName: customerId + target: + modelField: + - fieldName: customerId diff --git a/fixtures/hasura/chinook/metadata/relationships/employee_customers.hml b/fixtures/hasura/chinook/metadata/relationships/employee_customers.hml new file mode 100644 index 00000000..d6c31fee --- /dev/null +++ b/fixtures/hasura/chinook/metadata/relationships/employee_customers.hml @@ -0,0 +1,34 @@ +kind: Relationship +version: v1 +definition: + name: supportRepCustomers + source: Employee + target: + model: + name: Customer + relationshipType: Array + mapping: + - source: + fieldPath: + - fieldName: employeeId + target: + modelField: + - fieldName: supportRepId + +--- +kind: Relationship +version: v1 +definition: + name: supportRep + source: Customer + target: + model: + name: Employee + relationshipType: Object + mapping: + - source: + fieldPath: + - fieldName: supportRepId + target: + modelField: + - fieldName: employeeId diff --git a/fixtures/hasura/chinook/metadata/relationships/employee_employees.hml b/fixtures/hasura/chinook/metadata/relationships/employee_employees.hml new file mode 100644 index 00000000..0c44c388 --- /dev/null +++ b/fixtures/hasura/chinook/metadata/relationships/employee_employees.hml @@ -0,0 +1,34 @@ +kind: Relationship +version: v1 +definition: + name: directReports + source: Employee + target: + model: + name: Employee + relationshipType: Array + mapping: + - source: + fieldPath: + - fieldName: employeeId + target: + modelField: + - fieldName: reportsTo + +--- +kind: Relationship +version: v1 +definition: + name: manager + source: Employee + target: + model: + name: Employee + relationshipType: Object + mapping: + - source: + fieldPath: + - fieldName: reportsTo + target: + modelField: + - fieldName: employeeId diff --git a/fixtures/hasura/chinook/metadata/relationships/genre_tracks.hml b/fixtures/hasura/chinook/metadata/relationships/genre_tracks.hml new file mode 100644 index 00000000..7b5e49dd --- /dev/null +++ b/fixtures/hasura/chinook/metadata/relationships/genre_tracks.hml @@ -0,0 +1,34 @@ +kind: Relationship +version: v1 +definition: + name: tracks + source: Genre + target: + model: + name: Track + relationshipType: Array + mapping: + - source: + fieldPath: + - fieldName: genreId + target: + modelField: + - fieldName: genreId + +--- +kind: Relationship +version: v1 +definition: + name: genre + source: Track + target: + model: + name: Genre + relationshipType: Object + mapping: + - source: + fieldPath: + - fieldName: genreId + target: + modelField: + - fieldName: genreId diff --git a/fixtures/hasura/chinook/metadata/relationships/invoice_lines.hml b/fixtures/hasura/chinook/metadata/relationships/invoice_lines.hml new file mode 100644 index 00000000..3eaaf79c --- /dev/null +++ b/fixtures/hasura/chinook/metadata/relationships/invoice_lines.hml @@ -0,0 +1,34 @@ +kind: Relationship +version: v1 +definition: + name: lines + source: Invoice + target: + model: + name: InvoiceLine + relationshipType: Array + mapping: + - source: + fieldPath: + - fieldName: invoiceId + target: + modelField: + - fieldName: invoiceId + +--- +kind: Relationship +version: v1 +definition: + name: invoice + source: InvoiceLine + target: + model: + name: Invoice + relationshipType: Object + mapping: + - source: + fieldPath: + - fieldName: invoiceId + target: + modelField: + - fieldName: invoiceId diff --git a/fixtures/hasura/chinook/metadata/relationships/media_type_tracks.hml b/fixtures/hasura/chinook/metadata/relationships/media_type_tracks.hml new file mode 100644 index 00000000..54d2a77d --- /dev/null +++ b/fixtures/hasura/chinook/metadata/relationships/media_type_tracks.hml @@ -0,0 +1,34 @@ +kind: Relationship +version: v1 +definition: + name: tracks + source: MediaType + target: + model: + name: Track + relationshipType: Array + mapping: + - source: + fieldPath: + - fieldName: mediaTypeId + target: + modelField: + - fieldName: mediaTypeId + +--- +kind: Relationship +version: v1 +definition: + name: mediaType + source: Track + target: + model: + name: MediaType + relationshipType: Object + mapping: + - source: + fieldPath: + - fieldName: mediaTypeId + target: + modelField: + - fieldName: mediaTypeId diff --git a/fixtures/hasura/chinook/metadata/relationships/playlist_tracks.hml b/fixtures/hasura/chinook/metadata/relationships/playlist_tracks.hml new file mode 100644 index 00000000..cfe6fb1a --- /dev/null +++ b/fixtures/hasura/chinook/metadata/relationships/playlist_tracks.hml @@ -0,0 +1,70 @@ +kind: Relationship +version: v1 +definition: + name: playlistTracks + source: Playlist + target: + model: + name: PlaylistTrack + relationshipType: Array + mapping: + - source: + fieldPath: + - fieldName: playlistId + target: + modelField: + - fieldName: playlistId + +--- +kind: Relationship +version: v1 +definition: + name: playlist + source: PlaylistTrack + target: + model: + name: Playlist + relationshipType: Object + mapping: + - source: + fieldPath: + - fieldName: playlistId + target: + modelField: + - fieldName: playlistId + +--- +kind: Relationship +version: v1 +definition: + name: track + source: PlaylistTrack + target: + model: + name: Track + relationshipType: Object + mapping: + - source: + fieldPath: + - fieldName: trackId + target: + modelField: + - fieldName: trackId + +--- +kind: Relationship +version: v1 +definition: + name: playlistTracks + source: Track + target: + model: + name: PlaylistTrack + relationshipType: Array + mapping: + - source: + fieldPath: + - fieldName: trackId + target: + modelField: + - fieldName: trackId diff --git a/fixtures/hasura/chinook/metadata/relationships/track_invoice_lines.hml b/fixtures/hasura/chinook/metadata/relationships/track_invoice_lines.hml new file mode 100644 index 00000000..0576d71d --- /dev/null +++ b/fixtures/hasura/chinook/metadata/relationships/track_invoice_lines.hml @@ -0,0 +1,34 @@ +kind: Relationship +version: v1 +definition: + name: invoiceLines + source: Track + target: + model: + name: InvoiceLine + relationshipType: Array + mapping: + - source: + fieldPath: + - fieldName: trackId + target: + modelField: + - fieldName: trackId + +--- +kind: Relationship +version: v1 +definition: + name: track + source: InvoiceLine + target: + model: + name: Track + relationshipType: Object + mapping: + - source: + fieldPath: + - fieldName: trackId + target: + modelField: + - fieldName: trackId diff --git a/fixtures/hasura/sample_mflix/metadata/commands/Hello.hml b/fixtures/hasura/sample_mflix/metadata/commands/Hello.hml new file mode 100644 index 00000000..9e58d38c --- /dev/null +++ b/fixtures/hasura/sample_mflix/metadata/commands/Hello.hml @@ -0,0 +1,27 @@ +kind: Command +version: v1 +definition: + name: hello + description: Basic test of native queries + outputType: String + arguments: + - name: name + type: String! + source: + dataConnectorName: sample_mflix + dataConnectorCommand: + function: hello + argumentMapping: + name: name + graphql: + rootFieldName: hello + rootFieldKind: Query + +--- +kind: CommandPermissions +version: v1 +definition: + commandName: hello + permissions: + - role: admin + allowExecution: true diff --git a/fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix-types.hml b/fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix-types.hml new file mode 100644 index 00000000..dd8459ea --- /dev/null +++ b/fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix-types.hml @@ -0,0 +1,83 @@ +--- +kind: ScalarType +version: v1 +definition: + name: ObjectId + graphql: + typeName: ObjectId + +--- +kind: ScalarType +version: v1 +definition: + name: Date + graphql: + typeName: Date + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: sample_mflix + dataConnectorScalarType: ObjectId + representation: ObjectId + graphql: + comparisonExpressionTypeName: ObjectIdComparisonExp + +--- +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: ScalarType +version: v1 +definition: + name: ExtendedJson + graphql: + typeName: ExtendedJson + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: sample_mflix + dataConnectorScalarType: Int + representation: Int + graphql: + comparisonExpressionTypeName: IntComparisonExp + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: sample_mflix + dataConnectorScalarType: ExtendedJSON + representation: ExtendedJson + graphql: + comparisonExpressionTypeName: ExtendedJsonComparisonExp + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: sample_mflix + dataConnectorScalarType: Float + representation: Float + graphql: + comparisonExpressionTypeName: FloatComparisonExp diff --git a/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml b/fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix.hml similarity index 92% rename from fixtures/hasura/sample_mflix/metadata/sample_mflix.hml rename to fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix.hml index a984caca..e9f271a3 100644 --- a/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml +++ b/fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix.hml @@ -26,9 +26,7 @@ definition: argument_type: type: named name: BinData - Bool: - representation: - type: boolean + Boolean: aggregate_functions: count: result_type: @@ -41,10 +39,8 @@ definition: type: custom argument_type: type: named - name: Bool + name: Boolean Date: - representation: - type: timestamp aggregate_functions: count: result_type: @@ -101,8 +97,6 @@ definition: type: named name: DbPointer Decimal: - representation: - type: bigdecimal aggregate_functions: avg: result_type: @@ -152,14 +146,15 @@ definition: argument_type: type: named name: Decimal - Double: - representation: - type: float64 + ExtendedJSON: + aggregate_functions: {} + comparison_operators: {} + Float: aggregate_functions: avg: result_type: type: named - name: Double + name: Float count: result_type: type: named @@ -167,15 +162,15 @@ definition: max: result_type: type: named - name: Double + name: Float min: result_type: type: named - name: Double + name: Float sum: result_type: type: named - name: Double + name: Float comparison_operators: _eq: type: equal @@ -183,35 +178,28 @@ definition: type: custom argument_type: type: named - name: Double + name: Float _gte: type: custom argument_type: type: named - name: Double + name: Float _lt: type: custom argument_type: type: named - name: Double + name: Float _lte: type: custom argument_type: type: named - name: Double + name: Float _neq: type: custom argument_type: type: named - name: Double - ExtendedJSON: - representation: - type: json - aggregate_functions: {} - comparison_operators: {} + name: Float Int: - representation: - type: int32 aggregate_functions: avg: result_type: @@ -276,8 +264,6 @@ definition: name: Int comparison_operators: {} Long: - representation: - type: int64 aggregate_functions: avg: result_type: @@ -370,8 +356,6 @@ definition: type: named name: "Null" ObjectId: - representation: - type: string aggregate_functions: count: result_type: @@ -393,8 +377,6 @@ definition: name: Int comparison_operators: {} String: - representation: - type: string aggregate_functions: count: result_type: @@ -517,22 +499,6 @@ definition: type: named name: Undefined object_types: - Hello: - fields: - __value: - type: - type: named - name: String - TitleWordFrequency: - fields: - _id: - type: - type: named - name: String - count: - type: - type: named - name: Int comments: fields: _id: @@ -571,12 +537,10 @@ definition: name: movies_awards cast: type: - type: nullable - underlying_type: - type: array - element_type: - type: named - name: String + type: array + element_type: + type: named + name: String countries: type: type: array @@ -591,8 +555,10 @@ definition: name: String fullplot: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String genres: type: type: array @@ -627,12 +593,16 @@ definition: name: Int plot: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String poster: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String rated: type: type: nullable @@ -653,8 +623,10 @@ definition: name: String tomatoes: type: - type: named - name: movies_tomatoes + type: nullable + underlying_type: + type: named + name: movies_tomatoes type: type: type: named @@ -691,8 +663,10 @@ definition: name: Int rating: type: - type: named - name: Double + type: nullable + underlying_type: + type: named + name: Double votes: type: type: named @@ -759,10 +733,8 @@ definition: fields: meter: type: - type: nullable - underlying_type: - type: named - name: Int + type: named + name: Int numReviews: type: type: named @@ -858,7 +830,7 @@ definition: type: array element_type: type: named - name: Double + name: Float type: type: type: named @@ -881,6 +853,10 @@ definition: type: type: named name: String + TitleWordFrequency: + fields: + _id: { type: { type: named, name: String } } + count: { type: { type: named, name: Int } } collections: - name: comments arguments: {} @@ -914,42 +890,35 @@ definition: unique_columns: - _id foreign_keys: {} - - name: title_word_frequency - description: words appearing in movie titles with counts + - name: users arguments: {} - type: TitleWordFrequency + type: users uniqueness_constraints: - title_word_frequency_id: + users_id: unique_columns: - _id foreign_keys: {} - - name: users + - name: title_word_frequency arguments: {} - type: users + type: TitleWordFrequency uniqueness_constraints: - users_id: + title_word_frequency_id: unique_columns: - _id foreign_keys: {} functions: - name: hello description: Basic test of native queries + result_type: { type: named, name: String } arguments: - name: - type: - type: named - name: String - result_type: - type: named - name: String + name: { type: { type: named, name: String } } procedures: [] capabilities: - version: 0.1.4 + version: 0.1.1 capabilities: query: aggregates: {} variables: {} explain: {} mutation: {} - relationships: - relation_comparisons: {} + relationships: {} diff --git a/fixtures/hasura/sample_mflix/metadata/models/Comments.hml b/fixtures/hasura/sample_mflix/metadata/models/Comments.hml new file mode 100644 index 00000000..5e0cba4f --- /dev/null +++ b/fixtures/hasura/sample_mflix/metadata/models/Comments.hml @@ -0,0 +1,157 @@ +--- +kind: ObjectType +version: v1 +definition: + name: Comments + fields: + - name: id + type: ObjectId! + - name: date + type: Date! + - name: email + type: String! + - name: movieId + type: ObjectId! + - name: name + type: String! + - name: text + type: String! + graphql: + typeName: Comments + inputTypeName: CommentsInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: comments + fieldMapping: + id: + column: + name: _id + date: + column: + name: date + email: + column: + name: email + movieId: + column: + name: movie_id + name: + column: + name: name + text: + column: + name: text + +--- +kind: TypePermissions +version: v1 +definition: + typeName: Comments + permissions: + - role: admin + output: + allowedFields: + - id + - date + - email + - movieId + - name + - text + - role: user + output: + allowedFields: + - id + - date + - email + - movieId + - name + - text + +--- +kind: ObjectBooleanExpressionType +version: v1 +definition: + name: CommentsBoolExp + objectType: Comments + dataConnectorName: sample_mflix + dataConnectorObjectType: comments + comparableFields: + - fieldName: id + operators: + enableAll: true + - fieldName: date + operators: + enableAll: true + - fieldName: email + operators: + enableAll: true + - fieldName: movieId + operators: + enableAll: true + - fieldName: name + operators: + enableAll: true + - fieldName: text + operators: + enableAll: true + graphql: + typeName: CommentsBoolExp + +--- +kind: Model +version: v1 +definition: + name: Comments + objectType: Comments + source: + dataConnectorName: sample_mflix + collection: comments + filterExpressionType: CommentsBoolExp + orderableFields: + - fieldName: id + orderByDirections: + enableAll: true + - fieldName: date + orderByDirections: + enableAll: true + - fieldName: email + orderByDirections: + enableAll: true + - fieldName: movieId + orderByDirections: + enableAll: true + - fieldName: name + orderByDirections: + enableAll: true + - fieldName: text + orderByDirections: + enableAll: true + graphql: + selectMany: + queryRootField: comments + selectUniques: + - queryRootField: commentsById + uniqueIdentifier: + - id + orderByExpressionType: CommentsOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: Comments + permissions: + - role: admin + select: + filter: null + - role: user + select: + filter: + relationship: + name: user + predicate: + fieldComparison: + field: id + operator: _eq + value: + sessionVariable: x-hasura-user-id diff --git a/fixtures/hasura/sample_mflix/metadata/models/Movies.hml b/fixtures/hasura/sample_mflix/metadata/models/Movies.hml new file mode 100644 index 00000000..a4c6f5de --- /dev/null +++ b/fixtures/hasura/sample_mflix/metadata/models/Movies.hml @@ -0,0 +1,511 @@ +--- +kind: ObjectType +version: v1 +definition: + name: MoviesAwards + fields: + - name: nominations + type: Int! + - name: text + type: String! + - name: wins + type: Int! + graphql: + typeName: MoviesAwards + inputTypeName: MoviesAwardsInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: movies_awards + +--- +kind: TypePermissions +version: v1 +definition: + typeName: MoviesAwards + permissions: + - role: admin + output: + allowedFields: + - nominations + - text + - wins + +--- +kind: ObjectType +version: v1 +definition: + name: MoviesImdb + fields: + - name: id + type: Int! + - name: rating + type: ExtendedJson + - name: votes + type: Int! + graphql: + typeName: MoviesImdb + inputTypeName: MoviesImdbInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: movies_imdb + +--- +kind: TypePermissions +version: v1 +definition: + typeName: MoviesImdb + permissions: + - role: admin + output: + allowedFields: + - id + - rating + - votes + +--- +kind: ObjectType +version: v1 +definition: + name: MoviesTomatoesCritic + fields: + - name: meter + type: Int! + - name: numReviews + type: Int! + - name: rating + type: ExtendedJson + graphql: + typeName: MoviesTomatoesCritic + inputTypeName: MoviesTomatoesCriticInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: movies_tomatoes_critic + +--- +kind: TypePermissions +version: v1 +definition: + typeName: MoviesTomatoesCritic + permissions: + - role: admin + output: + allowedFields: + - meter + - numReviews + - rating + +--- +kind: ObjectType +version: v1 +definition: + name: MoviesTomatoesViewer + fields: + - name: meter + type: Int! + - name: numReviews + type: Int! + - name: rating + type: ExtendedJson + graphql: + typeName: MoviesTomatoesViewer + inputTypeName: MoviesTomatoesViewerInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: movies_tomatoes_viewer + +--- +kind: TypePermissions +version: v1 +definition: + typeName: MoviesTomatoesViewer + permissions: + - role: admin + output: + allowedFields: + - meter + - numReviews + - rating + +--- +kind: ObjectType +version: v1 +definition: + name: MoviesTomatoes + fields: + - name: boxOffice + type: String + - name: consensus + type: String + - name: critic + type: MoviesTomatoesCritic + - name: dvd + type: Date + - name: fresh + type: Int + - name: lastUpdated + type: Date! + - name: production + type: String + - name: rotten + type: Int + - name: viewer + type: MoviesTomatoesViewer! + - name: website + type: String + graphql: + typeName: MoviesTomatoes + inputTypeName: MoviesTomatoesInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: movies_tomatoes + +--- +kind: TypePermissions +version: v1 +definition: + typeName: MoviesTomatoes + permissions: + - role: admin + output: + allowedFields: + - boxOffice + - consensus + - critic + - dvd + - fresh + - lastUpdated + - production + - rotten + - viewer + - website + +--- +kind: ObjectType +version: v1 +definition: + name: Movies + fields: + - name: id + type: ObjectId! + - name: awards + type: MoviesAwards! + - name: cast + type: "[String!]!" + - name: countries + type: "[String!]!" + - name: directors + type: "[String!]!" + - name: fullplot + type: String + - name: genres + type: "[String!]!" + - name: imdb + type: MoviesImdb! + - name: languages + type: "[String!]!" + - name: lastupdated + type: String! + - name: metacritic + type: Int + - name: numMflixComments + type: Int + - name: plot + type: String + - name: poster + type: String + - name: rated + type: String + - name: released + type: Date! + - name: runtime + type: Int! + - name: title + type: String! + - name: tomatoes + type: MoviesTomatoes + - name: type + type: String! + - name: writers + type: "[String!]!" + - name: year + type: Int! + graphql: + typeName: Movies + inputTypeName: MoviesInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: movies + fieldMapping: + id: + column: + name: _id + awards: + column: + name: awards + cast: + column: + name: cast + countries: + column: + name: countries + directors: + column: + name: directors + fullplot: + column: + name: fullplot + genres: + column: + name: genres + imdb: + column: + name: imdb + languages: + column: + name: languages + lastupdated: + column: + name: lastupdated + metacritic: + column: + name: metacritic + numMflixComments: + column: + name: num_mflix_comments + plot: + column: + name: plot + poster: + column: + name: poster + rated: + column: + name: rated + released: + column: + name: released + runtime: + column: + name: runtime + title: + column: + name: title + tomatoes: + column: + name: tomatoes + type: + column: + name: type + writers: + column: + name: writers + year: + column: + name: year + +--- +kind: TypePermissions +version: v1 +definition: + typeName: Movies + permissions: + - role: admin + output: + allowedFields: + - id + - awards + - cast + - countries + - directors + - fullplot + - genres + - imdb + - languages + - lastupdated + - metacritic + - numMflixComments + - plot + - poster + - rated + - released + - runtime + - title + - tomatoes + - type + - writers + - year + +--- +kind: ObjectBooleanExpressionType +version: v1 +definition: + name: MoviesBoolExp + objectType: Movies + dataConnectorName: sample_mflix + dataConnectorObjectType: movies + comparableFields: + - fieldName: id + operators: + enableAll: true + - fieldName: awards + operators: + enableAll: true + - fieldName: cast + operators: + enableAll: true + - fieldName: countries + operators: + enableAll: true + - fieldName: directors + operators: + enableAll: true + - fieldName: fullplot + operators: + enableAll: true + - fieldName: genres + operators: + enableAll: true + - fieldName: imdb + operators: + enableAll: true + - fieldName: languages + operators: + enableAll: true + - fieldName: lastupdated + operators: + enableAll: true + - fieldName: metacritic + operators: + enableAll: true + - fieldName: numMflixComments + operators: + enableAll: true + - fieldName: plot + operators: + enableAll: true + - fieldName: poster + operators: + enableAll: true + - fieldName: rated + operators: + enableAll: true + - fieldName: released + operators: + enableAll: true + - fieldName: runtime + operators: + enableAll: true + - fieldName: title + operators: + enableAll: true + - fieldName: tomatoes + operators: + enableAll: true + - fieldName: type + operators: + enableAll: true + - fieldName: writers + operators: + enableAll: true + - fieldName: year + operators: + enableAll: true + graphql: + typeName: MoviesBoolExp + +--- +kind: Model +version: v1 +definition: + name: Movies + objectType: Movies + source: + dataConnectorName: sample_mflix + collection: movies + filterExpressionType: MoviesBoolExp + orderableFields: + - fieldName: id + orderByDirections: + enableAll: true + - fieldName: awards + orderByDirections: + enableAll: true + - fieldName: cast + orderByDirections: + enableAll: true + - fieldName: countries + orderByDirections: + enableAll: true + - fieldName: directors + orderByDirections: + enableAll: true + - fieldName: fullplot + orderByDirections: + enableAll: true + - fieldName: genres + orderByDirections: + enableAll: true + - fieldName: imdb + orderByDirections: + enableAll: true + - fieldName: languages + orderByDirections: + enableAll: true + - fieldName: lastupdated + orderByDirections: + enableAll: true + - fieldName: metacritic + orderByDirections: + enableAll: true + - fieldName: numMflixComments + orderByDirections: + enableAll: true + - fieldName: plot + orderByDirections: + enableAll: true + - fieldName: poster + orderByDirections: + enableAll: true + - fieldName: rated + orderByDirections: + enableAll: true + - fieldName: released + orderByDirections: + enableAll: true + - fieldName: runtime + orderByDirections: + enableAll: true + - fieldName: title + orderByDirections: + enableAll: true + - fieldName: tomatoes + orderByDirections: + enableAll: true + - fieldName: type + orderByDirections: + enableAll: true + - fieldName: writers + orderByDirections: + enableAll: true + - fieldName: year + orderByDirections: + enableAll: true + graphql: + selectMany: + queryRootField: movies + selectUniques: + - queryRootField: moviesById + uniqueIdentifier: + - id + orderByExpressionType: MoviesOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: Movies + permissions: + - role: admin + select: + filter: null + diff --git a/fixtures/hasura/sample_mflix/metadata/models/Sessions.hml b/fixtures/hasura/sample_mflix/metadata/models/Sessions.hml new file mode 100644 index 00000000..50f3969f --- /dev/null +++ b/fixtures/hasura/sample_mflix/metadata/models/Sessions.hml @@ -0,0 +1,102 @@ +--- +kind: ObjectType +version: v1 +definition: + name: Sessions + fields: + - name: id + type: ObjectId! + - name: jwt + type: String! + - name: userId + type: String! + graphql: + typeName: Sessions + inputTypeName: SessionsInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: sessions + fieldMapping: + id: + column: + name: _id + jwt: + column: + name: jwt + userId: + column: + name: user_id + +--- +kind: TypePermissions +version: v1 +definition: + typeName: Sessions + permissions: + - role: admin + output: + allowedFields: + - id + - jwt + - userId + +--- +kind: ObjectBooleanExpressionType +version: v1 +definition: + name: SessionsBoolExp + objectType: Sessions + dataConnectorName: sample_mflix + dataConnectorObjectType: sessions + comparableFields: + - fieldName: id + operators: + enableAll: true + - fieldName: jwt + operators: + enableAll: true + - fieldName: userId + operators: + enableAll: true + graphql: + typeName: SessionsBoolExp + +--- +kind: Model +version: v1 +definition: + name: Sessions + objectType: Sessions + source: + dataConnectorName: sample_mflix + collection: sessions + filterExpressionType: SessionsBoolExp + orderableFields: + - fieldName: id + orderByDirections: + enableAll: true + - fieldName: jwt + orderByDirections: + enableAll: true + - fieldName: userId + orderByDirections: + enableAll: true + graphql: + selectMany: + queryRootField: sessions + selectUniques: + - queryRootField: sessionsById + uniqueIdentifier: + - id + orderByExpressionType: SessionsOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: Sessions + permissions: + - role: admin + select: + filter: null + diff --git a/fixtures/hasura/sample_mflix/metadata/models/Theaters.hml b/fixtures/hasura/sample_mflix/metadata/models/Theaters.hml new file mode 100644 index 00000000..0c534319 --- /dev/null +++ b/fixtures/hasura/sample_mflix/metadata/models/Theaters.hml @@ -0,0 +1,198 @@ +--- +kind: ObjectType +version: v1 +definition: + name: TheatersLocationAddress + fields: + - name: city + type: String! + - name: state + type: String! + - name: street1 + type: String! + - name: street2 + type: String + - name: zipcode + type: String! + graphql: + typeName: TheatersLocationAddress + inputTypeName: TheatersLocationAddressInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: theaters_location_address + +--- +kind: TypePermissions +version: v1 +definition: + typeName: TheatersLocationAddress + permissions: + - role: admin + output: + allowedFields: + - city + - state + - street1 + - street2 + - zipcode + +--- +kind: ObjectType +version: v1 +definition: + name: TheatersLocationGeo + fields: + - name: coordinates + type: "[Float!]!" + - name: type + type: String! + graphql: + typeName: TheatersLocationGeo + inputTypeName: TheatersLocationGeoInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: theaters_location_geo + +--- +kind: TypePermissions +version: v1 +definition: + typeName: TheatersLocationGeo + permissions: + - role: admin + output: + allowedFields: + - coordinates + - type + +--- +kind: ObjectType +version: v1 +definition: + name: TheatersLocation + fields: + - name: address + type: TheatersLocationAddress! + - name: geo + type: TheatersLocationGeo! + graphql: + typeName: TheatersLocation + inputTypeName: TheatersLocationInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: theaters_location + +--- +kind: TypePermissions +version: v1 +definition: + typeName: TheatersLocation + permissions: + - role: admin + output: + allowedFields: + - address + - geo + +--- +kind: ObjectType +version: v1 +definition: + name: Theaters + fields: + - name: id + type: ObjectId! + - name: location + type: TheatersLocation! + - name: theaterId + type: Int! + graphql: + typeName: Theaters + inputTypeName: TheatersInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: theaters + fieldMapping: + id: + column: + name: _id + location: + column: + name: location + theaterId: + column: + name: theaterId + +--- +kind: TypePermissions +version: v1 +definition: + typeName: Theaters + permissions: + - role: admin + output: + allowedFields: + - id + - location + - theaterId + +--- +kind: ObjectBooleanExpressionType +version: v1 +definition: + name: TheatersBoolExp + objectType: Theaters + dataConnectorName: sample_mflix + dataConnectorObjectType: theaters + comparableFields: + - fieldName: id + operators: + enableAll: true + - fieldName: location + operators: + enableAll: true + - fieldName: theaterId + operators: + enableAll: true + graphql: + typeName: TheatersBoolExp + +--- +kind: Model +version: v1 +definition: + name: Theaters + objectType: Theaters + source: + dataConnectorName: sample_mflix + collection: theaters + filterExpressionType: TheatersBoolExp + orderableFields: + - fieldName: id + orderByDirections: + enableAll: true + - fieldName: location + orderByDirections: + enableAll: true + - fieldName: theaterId + orderByDirections: + enableAll: true + graphql: + selectMany: + queryRootField: theaters + selectUniques: + - queryRootField: theatersById + uniqueIdentifier: + - id + orderByExpressionType: TheatersOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: Theaters + permissions: + - role: admin + select: + filter: null + diff --git a/fixtures/hasura/sample_mflix/metadata/models/TitleWordFrequency.hml b/fixtures/hasura/sample_mflix/metadata/models/TitleWordFrequency.hml new file mode 100644 index 00000000..a1a58c7e --- /dev/null +++ b/fixtures/hasura/sample_mflix/metadata/models/TitleWordFrequency.hml @@ -0,0 +1,90 @@ +--- +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: ObjectBooleanExpressionType +version: v1 +definition: + name: TitleWordFrequencyBoolExp + objectType: TitleWordFrequency + dataConnectorName: sample_mflix + dataConnectorObjectType: TitleWordFrequency + comparableFields: + - fieldName: word + operators: + enableAll: true + - fieldName: count + operators: + enableAll: true + graphql: + typeName: TitleWordFrequencyBoolExp + +--- +kind: Model +version: v1 +definition: + name: TitleWordFrequency + objectType: TitleWordFrequency + source: + dataConnectorName: sample_mflix + collection: title_word_frequency + filterExpressionType: TitleWordFrequencyBoolExp + 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 + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: TitleWordFrequency + permissions: + - role: admin + select: + filter: null + diff --git a/fixtures/hasura/sample_mflix/metadata/models/Users.hml b/fixtures/hasura/sample_mflix/metadata/models/Users.hml new file mode 100644 index 00000000..48ba8510 --- /dev/null +++ b/fixtures/hasura/sample_mflix/metadata/models/Users.hml @@ -0,0 +1,127 @@ +--- +kind: ObjectType +version: v1 +definition: + name: Users + fields: + - name: id + type: ObjectId! + - name: email + type: String! + - name: name + type: String! + - name: password + type: String! + graphql: + typeName: Users + inputTypeName: UsersInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: users + fieldMapping: + id: + column: + name: _id + email: + column: + name: email + name: + column: + name: name + password: + column: + name: password + +--- +kind: TypePermissions +version: v1 +definition: + typeName: Users + permissions: + - role: admin + output: + allowedFields: + - id + - email + - name + - password + - role: user + output: + allowedFields: + - id + - email + - name + +--- +kind: ObjectBooleanExpressionType +version: v1 +definition: + name: UsersBoolExp + objectType: Users + dataConnectorName: sample_mflix + dataConnectorObjectType: users + comparableFields: + - fieldName: id + operators: + enableAll: true + - fieldName: email + operators: + enableAll: true + - fieldName: name + operators: + enableAll: true + - fieldName: password + operators: + enableAll: true + graphql: + typeName: UsersBoolExp + +--- +kind: Model +version: v1 +definition: + name: Users + objectType: Users + source: + dataConnectorName: sample_mflix + collection: users + filterExpressionType: UsersBoolExp + orderableFields: + - fieldName: id + orderByDirections: + enableAll: true + - fieldName: email + orderByDirections: + enableAll: true + - fieldName: name + orderByDirections: + enableAll: true + - fieldName: password + orderByDirections: + enableAll: true + graphql: + selectMany: + queryRootField: users + selectUniques: + - queryRootField: usersById + uniqueIdentifier: + - id + orderByExpressionType: UsersOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: Users + permissions: + - role: admin + select: + filter: null + - role: user + select: + filter: + fieldComparison: + field: id + operator: _eq + value: + sessionVariable: x-hasura-user-id diff --git a/fixtures/hasura/sample_mflix/metadata/relationships/movie_comments.hml b/fixtures/hasura/sample_mflix/metadata/relationships/movie_comments.hml new file mode 100644 index 00000000..fdb475b4 --- /dev/null +++ b/fixtures/hasura/sample_mflix/metadata/relationships/movie_comments.hml @@ -0,0 +1,35 @@ +kind: Relationship +version: v1 +definition: + name: comments + source: Movies + target: + model: + name: Comments + relationshipType: Array + mapping: + - source: + fieldPath: + - fieldName: id + target: + modelField: + - fieldName: movieId + +--- +kind: Relationship +version: v1 +definition: + name: movie + source: Comments + target: + model: + name: Movies + relationshipType: Object + mapping: + - source: + fieldPath: + - fieldName: movieId + target: + modelField: + - fieldName: id + diff --git a/fixtures/hasura/sample_mflix/metadata/relationships/user_comments.hml b/fixtures/hasura/sample_mflix/metadata/relationships/user_comments.hml new file mode 100644 index 00000000..25d5304d --- /dev/null +++ b/fixtures/hasura/sample_mflix/metadata/relationships/user_comments.hml @@ -0,0 +1,34 @@ +kind: Relationship +version: v1 +definition: + name: comments + source: Users + target: + model: + name: Comments + relationshipType: Array + mapping: + - source: + fieldPath: + - fieldName: email + target: + modelField: + - fieldName: email + +--- +kind: Relationship +version: v1 +definition: + name: user + source: Comments + target: + model: + name: Users + relationshipType: Object + mapping: + - source: + fieldPath: + - fieldName: email + target: + modelField: + - fieldName: email From 7a231e94ba87886305c5d99af5b8247b50cddb19 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Thu, 13 Jun 2024 15:23:07 -0700 Subject: [PATCH 17/34] update dataconnector links --- .../metadata/dataconnectors/chinook.hml | 291 ++++++++++++------ .../metadata/dataconnectors/sample_mflix.hml | 143 +++++---- 2 files changed, 284 insertions(+), 150 deletions(-) diff --git a/fixtures/hasura/chinook/metadata/dataconnectors/chinook.hml b/fixtures/hasura/chinook/metadata/dataconnectors/chinook.hml index 5f65ea10..487f72a4 100644 --- a/fixtures/hasura/chinook/metadata/dataconnectors/chinook.hml +++ b/fixtures/hasura/chinook/metadata/dataconnectors/chinook.hml @@ -26,7 +26,9 @@ definition: argument_type: type: named name: BinData - Boolean: + Bool: + representation: + type: boolean aggregate_functions: count: result_type: @@ -39,8 +41,10 @@ definition: type: custom argument_type: type: named - name: Boolean + name: Bool Date: + representation: + type: timestamp aggregate_functions: count: result_type: @@ -97,6 +101,8 @@ definition: type: named name: DbPointer Decimal: + representation: + type: bigdecimal aggregate_functions: avg: result_type: @@ -146,15 +152,14 @@ definition: argument_type: type: named name: Decimal - ExtendedJSON: - aggregate_functions: {} - comparison_operators: {} - Float: + Double: + representation: + type: float64 aggregate_functions: avg: result_type: type: named - name: Float + name: Double count: result_type: type: named @@ -162,15 +167,15 @@ definition: max: result_type: type: named - name: Float + name: Double min: result_type: type: named - name: Float + name: Double sum: result_type: type: named - name: Float + name: Double comparison_operators: _eq: type: equal @@ -178,28 +183,35 @@ definition: type: custom argument_type: type: named - name: Float + name: Double _gte: type: custom argument_type: type: named - name: Float + name: Double _lt: type: custom argument_type: type: named - name: Float + name: Double _lte: type: custom argument_type: type: named - name: Float + name: Double _neq: type: custom argument_type: type: named - name: Float + name: Double + ExtendedJSON: + representation: + type: json + aggregate_functions: {} + comparison_operators: {} Int: + representation: + type: int32 aggregate_functions: avg: result_type: @@ -264,6 +276,8 @@ definition: name: Int comparison_operators: {} Long: + representation: + type: int64 aggregate_functions: avg: result_type: @@ -356,6 +370,8 @@ definition: type: named name: "Null" ObjectId: + representation: + type: string aggregate_functions: count: result_type: @@ -377,6 +393,8 @@ definition: name: Int comparison_operators: {} String: + representation: + type: string aggregate_functions: count: result_type: @@ -500,6 +518,7 @@ definition: name: Undefined object_types: Album: + description: Object type for collection Album fields: _id: type: @@ -518,6 +537,7 @@ definition: type: named name: String Artist: + description: Object type for collection Artist fields: _id: type: @@ -529,9 +549,12 @@ definition: name: Int Name: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String Customer: + description: Object type for collection Customer fields: _id: type: @@ -539,20 +562,28 @@ definition: name: ObjectId Address: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String City: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String Company: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String Country: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String CustomerId: type: type: named @@ -563,8 +594,10 @@ definition: name: String Fax: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String FirstName: type: type: named @@ -575,23 +608,30 @@ definition: name: String Phone: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String PostalCode: type: type: nullable underlying_type: type: named - name: ExtendedJSON + name: String State: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String SupportRepId: type: - type: named - name: Int + type: nullable + underlying_type: + type: named + name: Int Employee: + description: Object type for collection Employee fields: _id: type: @@ -599,52 +639,70 @@ definition: name: ObjectId Address: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String BirthDate: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String City: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String Country: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String Email: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String EmployeeId: type: type: named name: Int Fax: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String FirstName: type: type: named name: String HireDate: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String LastName: type: type: named name: String Phone: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String PostalCode: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String ReportsTo: type: type: nullable @@ -653,13 +711,18 @@ definition: name: Int State: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String Title: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String Genre: + description: Object type for collection Genre fields: _id: type: @@ -670,10 +733,23 @@ definition: type: named name: Int Name: + type: + type: nullable + underlying_type: + type: named + name: String + InsertArtist: + fields: + "n": type: type: named - name: String + name: Int + ok: + type: + type: named + name: Double Invoice: + description: Object type for collection Invoice fields: _id: type: @@ -681,26 +757,34 @@ definition: name: ObjectId BillingAddress: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String BillingCity: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String BillingCountry: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String BillingPostalCode: type: type: nullable underlying_type: type: named - name: ExtendedJSON + name: String BillingState: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String CustomerId: type: type: named @@ -716,8 +800,9 @@ definition: Total: type: type: named - name: Float + name: Decimal InvoiceLine: + description: Object type for collection InvoiceLine fields: _id: type: @@ -742,8 +827,9 @@ definition: UnitPrice: type: type: named - name: Float + name: Decimal MediaType: + description: Object type for collection MediaType fields: _id: type: @@ -755,9 +841,12 @@ definition: name: Int Name: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String Playlist: + description: Object type for collection Playlist fields: _id: type: @@ -765,13 +854,16 @@ definition: name: ObjectId Name: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String PlaylistId: type: type: named name: Int PlaylistTrack: + description: Object type for collection PlaylistTrack fields: _id: type: @@ -786,6 +878,7 @@ definition: type: named name: Int Track: + description: Object type for collection Track fields: _id: type: @@ -793,20 +886,28 @@ definition: name: ObjectId AlbumId: type: - type: named - name: Int + type: nullable + underlying_type: + type: named + name: Int Bytes: type: - type: named - name: Int + type: nullable + underlying_type: + type: named + name: Int Composer: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String GenreId: type: - type: named - name: Int + type: nullable + underlying_type: + type: named + name: Int MediaTypeId: type: type: named @@ -826,13 +927,7 @@ definition: UnitPrice: type: type: named - name: Float - InsertArtist: - fields: - ok: - type: { type: named, name: Double } - n: - type: { type: named, name: Int } + name: Decimal collections: - name: Album arguments: {} @@ -925,18 +1020,26 @@ definition: functions: [] procedures: - name: insertArtist - description: Example of a database update using a native procedure - result_type: { type: named, name: InsertArtist } + description: Example of a database update using a native mutation arguments: - id: { type: { type: named, name: Int } } - name: { type: { type: named, name: String } } + id: + type: + type: named + name: Int + name: + type: + type: named + name: String + result_type: + type: named + name: InsertArtist capabilities: - version: 0.1.1 + version: 0.1.4 capabilities: query: aggregates: {} variables: {} explain: {} mutation: {} - relationships: {} - + relationships: + relation_comparisons: {} diff --git a/fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix.hml b/fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix.hml index e9f271a3..a984caca 100644 --- a/fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix.hml +++ b/fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix.hml @@ -26,7 +26,9 @@ definition: argument_type: type: named name: BinData - Boolean: + Bool: + representation: + type: boolean aggregate_functions: count: result_type: @@ -39,8 +41,10 @@ definition: type: custom argument_type: type: named - name: Boolean + name: Bool Date: + representation: + type: timestamp aggregate_functions: count: result_type: @@ -97,6 +101,8 @@ definition: type: named name: DbPointer Decimal: + representation: + type: bigdecimal aggregate_functions: avg: result_type: @@ -146,15 +152,14 @@ definition: argument_type: type: named name: Decimal - ExtendedJSON: - aggregate_functions: {} - comparison_operators: {} - Float: + Double: + representation: + type: float64 aggregate_functions: avg: result_type: type: named - name: Float + name: Double count: result_type: type: named @@ -162,15 +167,15 @@ definition: max: result_type: type: named - name: Float + name: Double min: result_type: type: named - name: Float + name: Double sum: result_type: type: named - name: Float + name: Double comparison_operators: _eq: type: equal @@ -178,28 +183,35 @@ definition: type: custom argument_type: type: named - name: Float + name: Double _gte: type: custom argument_type: type: named - name: Float + name: Double _lt: type: custom argument_type: type: named - name: Float + name: Double _lte: type: custom argument_type: type: named - name: Float + name: Double _neq: type: custom argument_type: type: named - name: Float + name: Double + ExtendedJSON: + representation: + type: json + aggregate_functions: {} + comparison_operators: {} Int: + representation: + type: int32 aggregate_functions: avg: result_type: @@ -264,6 +276,8 @@ definition: name: Int comparison_operators: {} Long: + representation: + type: int64 aggregate_functions: avg: result_type: @@ -356,6 +370,8 @@ definition: type: named name: "Null" ObjectId: + representation: + type: string aggregate_functions: count: result_type: @@ -377,6 +393,8 @@ definition: name: Int comparison_operators: {} String: + representation: + type: string aggregate_functions: count: result_type: @@ -499,6 +517,22 @@ definition: type: named name: Undefined object_types: + Hello: + fields: + __value: + type: + type: named + name: String + TitleWordFrequency: + fields: + _id: + type: + type: named + name: String + count: + type: + type: named + name: Int comments: fields: _id: @@ -537,10 +571,12 @@ definition: name: movies_awards cast: type: - type: array - element_type: - type: named - name: String + type: nullable + underlying_type: + type: array + element_type: + type: named + name: String countries: type: type: array @@ -555,10 +591,8 @@ definition: name: String fullplot: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String genres: type: type: array @@ -593,16 +627,12 @@ definition: name: Int plot: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String poster: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String rated: type: type: nullable @@ -623,10 +653,8 @@ definition: name: String tomatoes: type: - type: nullable - underlying_type: - type: named - name: movies_tomatoes + type: named + name: movies_tomatoes type: type: type: named @@ -663,10 +691,8 @@ definition: name: Int rating: type: - type: nullable - underlying_type: - type: named - name: Double + type: named + name: Double votes: type: type: named @@ -733,8 +759,10 @@ definition: fields: meter: type: - type: named - name: Int + type: nullable + underlying_type: + type: named + name: Int numReviews: type: type: named @@ -830,7 +858,7 @@ definition: type: array element_type: type: named - name: Float + name: Double type: type: type: named @@ -853,10 +881,6 @@ definition: type: type: named name: String - TitleWordFrequency: - fields: - _id: { type: { type: named, name: String } } - count: { type: { type: named, name: Int } } collections: - name: comments arguments: {} @@ -890,35 +914,42 @@ definition: unique_columns: - _id foreign_keys: {} - - name: users + - name: title_word_frequency + description: words appearing in movie titles with counts arguments: {} - type: users + type: TitleWordFrequency uniqueness_constraints: - users_id: + title_word_frequency_id: unique_columns: - _id foreign_keys: {} - - name: title_word_frequency + - name: users arguments: {} - type: TitleWordFrequency + type: users uniqueness_constraints: - title_word_frequency_id: + users_id: unique_columns: - _id foreign_keys: {} functions: - name: hello description: Basic test of native queries - result_type: { type: named, name: String } arguments: - name: { type: { type: named, name: String } } + name: + type: + type: named + name: String + result_type: + type: named + name: String procedures: [] capabilities: - version: 0.1.1 + version: 0.1.4 capabilities: query: aggregates: {} variables: {} explain: {} mutation: {} - relationships: {} + relationships: + relation_comparisons: {} From 5cd7f2f7e42584717ffbc6a4e46c0d95d3911908 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Thu, 13 Jun 2024 15:36:23 -0700 Subject: [PATCH 18/34] update sample_mflix models --- .../sample_mflix/metadata/commands/Hello.hml | 4 +++- .../dataconnectors/sample_mflix-types.hml | 4 ++-- .../sample_mflix/metadata/models/Movies.hml | 18 +++++++++--------- .../sample_mflix/metadata/models/Theaters.hml | 2 +- .../metadata/models/TitleWordFrequency.hml | 1 + 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/fixtures/hasura/sample_mflix/metadata/commands/Hello.hml b/fixtures/hasura/sample_mflix/metadata/commands/Hello.hml index 9e58d38c..b0c1cc4b 100644 --- a/fixtures/hasura/sample_mflix/metadata/commands/Hello.hml +++ b/fixtures/hasura/sample_mflix/metadata/commands/Hello.hml @@ -1,9 +1,10 @@ +--- kind: Command version: v1 definition: name: hello description: Basic test of native queries - outputType: String + outputType: String! arguments: - name: name type: String! @@ -25,3 +26,4 @@ definition: permissions: - role: admin allowExecution: true + diff --git a/fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix-types.hml b/fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix-types.hml index dd8459ea..b14b2b65 100644 --- a/fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix-types.hml +++ b/fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix-types.hml @@ -77,7 +77,7 @@ kind: DataConnectorScalarRepresentation version: v1 definition: dataConnectorName: sample_mflix - dataConnectorScalarType: Float + dataConnectorScalarType: Double representation: Float graphql: - comparisonExpressionTypeName: FloatComparisonExp + comparisonExpressionTypeName: DoubleComparisonExp diff --git a/fixtures/hasura/sample_mflix/metadata/models/Movies.hml b/fixtures/hasura/sample_mflix/metadata/models/Movies.hml index a4c6f5de..9eec3082 100644 --- a/fixtures/hasura/sample_mflix/metadata/models/Movies.hml +++ b/fixtures/hasura/sample_mflix/metadata/models/Movies.hml @@ -39,7 +39,7 @@ definition: - name: id type: Int! - name: rating - type: ExtendedJson + type: Double! - name: votes type: Int! graphql: @@ -69,11 +69,11 @@ definition: name: MoviesTomatoesCritic fields: - name: meter - type: Int! + type: Int - name: numReviews type: Int! - name: rating - type: ExtendedJson + type: Double graphql: typeName: MoviesTomatoesCritic inputTypeName: MoviesTomatoesCriticInput @@ -105,7 +105,7 @@ definition: - name: numReviews type: Int! - name: rating - type: ExtendedJson + type: Double graphql: typeName: MoviesTomatoesViewer inputTypeName: MoviesTomatoesViewerInput @@ -190,13 +190,13 @@ definition: - name: awards type: MoviesAwards! - name: cast - type: "[String!]!" + type: "[String!]" - name: countries type: "[String!]!" - name: directors type: "[String!]!" - name: fullplot - type: String + type: String! - name: genres type: "[String!]!" - name: imdb @@ -210,9 +210,9 @@ definition: - name: numMflixComments type: Int - name: plot - type: String + type: String! - name: poster - type: String + type: String! - name: rated type: String - name: released @@ -222,7 +222,7 @@ definition: - name: title type: String! - name: tomatoes - type: MoviesTomatoes + type: MoviesTomatoes! - name: type type: String! - name: writers diff --git a/fixtures/hasura/sample_mflix/metadata/models/Theaters.hml b/fixtures/hasura/sample_mflix/metadata/models/Theaters.hml index 0c534319..7620bb60 100644 --- a/fixtures/hasura/sample_mflix/metadata/models/Theaters.hml +++ b/fixtures/hasura/sample_mflix/metadata/models/Theaters.hml @@ -43,7 +43,7 @@ definition: name: TheatersLocationGeo fields: - name: coordinates - type: "[Float!]!" + type: "[Double!]!" - name: type type: String! graphql: diff --git a/fixtures/hasura/sample_mflix/metadata/models/TitleWordFrequency.hml b/fixtures/hasura/sample_mflix/metadata/models/TitleWordFrequency.hml index a1a58c7e..19d781e2 100644 --- a/fixtures/hasura/sample_mflix/metadata/models/TitleWordFrequency.hml +++ b/fixtures/hasura/sample_mflix/metadata/models/TitleWordFrequency.hml @@ -77,6 +77,7 @@ definition: uniqueIdentifier: - word orderByExpressionType: TitleWordFrequencyOrderBy + description: words appearing in movie titles with counts --- kind: ModelPermissions From 1ada7da1c366735da72ff3b3e39eca6f71924b31 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Thu, 13 Jun 2024 15:39:35 -0700 Subject: [PATCH 19/34] update chinook models --- .../metadata/commands/InsertArtist.hml | 19 ++++++--- .../metadata/dataconnectors/chinook-types.hml | 42 +++++++++++++------ .../hasura/chinook/metadata/models/Album.hml | 1 + .../hasura/chinook/metadata/models/Artist.hml | 3 +- .../chinook/metadata/models/Customer.hml | 19 +++++---- .../chinook/metadata/models/Employee.hml | 23 +++++----- .../hasura/chinook/metadata/models/Genre.hml | 3 +- .../chinook/metadata/models/Invoice.hml | 13 +++--- .../chinook/metadata/models/InvoiceLine.hml | 3 +- .../chinook/metadata/models/MediaType.hml | 3 +- .../chinook/metadata/models/Playlist.hml | 3 +- .../chinook/metadata/models/PlaylistTrack.hml | 1 + .../hasura/chinook/metadata/models/Track.hml | 11 ++--- 13 files changed, 90 insertions(+), 54 deletions(-) diff --git a/fixtures/hasura/chinook/metadata/commands/InsertArtist.hml b/fixtures/hasura/chinook/metadata/commands/InsertArtist.hml index 9dd323da..6e5c835e 100644 --- a/fixtures/hasura/chinook/metadata/commands/InsertArtist.hml +++ b/fixtures/hasura/chinook/metadata/commands/InsertArtist.hml @@ -1,12 +1,13 @@ +--- kind: Command version: v1 definition: name: insertArtist description: Example of a database update using a native mutation - outputType: InsertArtist + outputType: InsertArtist! arguments: - name: id - type: Int! + type: Int! - name: name type: String! source: @@ -28,7 +29,7 @@ definition: permissions: - role: admin allowExecution: true - + --- kind: ObjectType version: v1 @@ -36,17 +37,22 @@ definition: name: InsertArtist graphql: typeName: InsertArtist + inputTypeName: InsertArtistInput fields: - name: ok - type: Float! + type: Double! - name: n type: Int! dataConnectorTypeMapping: - dataConnectorName: chinook dataConnectorObjectType: InsertArtist fieldMapping: - ok: { column: { name: ok } } - n: { column: { name: n } } + ok: + column: + name: ok + n: + column: + name: n --- kind: TypePermissions @@ -59,3 +65,4 @@ definition: allowedFields: - ok - n + diff --git a/fixtures/hasura/chinook/metadata/dataconnectors/chinook-types.hml b/fixtures/hasura/chinook/metadata/dataconnectors/chinook-types.hml index 8be96015..e3e39566 100644 --- a/fixtures/hasura/chinook/metadata/dataconnectors/chinook-types.hml +++ b/fixtures/hasura/chinook/metadata/dataconnectors/chinook-types.hml @@ -24,42 +24,60 @@ definition: dataConnectorScalarType: Int representation: Int graphql: - comparisonExpressionTypeName: IntComparisonExp + comparisonExpressionTypeName: Chinook_IntComparisonExp --- kind: DataConnectorScalarRepresentation version: v1 definition: dataConnectorName: chinook - dataConnectorScalarType: String - representation: String + dataConnectorScalarType: Double + representation: Float graphql: - comparisonExpressionTypeName: StringComparisonExp + comparisonExpressionTypeName: Chinook_DoubleComparisonExp --- kind: ScalarType version: v1 definition: - name: Chinook_ExtendedJson + name: Decimal graphql: - typeName: Chinook_ExtendedJson + typeName: Chinook_Decimal --- kind: DataConnectorScalarRepresentation version: v1 definition: dataConnectorName: chinook - dataConnectorScalarType: ExtendedJSON - representation: Chinook_ExtendedJson + dataConnectorScalarType: Decimal + representation: Decimal graphql: - comparisonExpressionTypeName: Chinook_ExtendedJsonComparisonExp + comparisonExpressionTypeName: Chinook_DecimalComparisonExp --- kind: DataConnectorScalarRepresentation version: v1 definition: dataConnectorName: chinook - dataConnectorScalarType: Float - representation: Float + dataConnectorScalarType: String + representation: String graphql: - comparisonExpressionTypeName: FloatComparisonExp + comparisonExpressionTypeName: Chinook_StringComparisonExp + +--- +kind: ScalarType +version: v1 +definition: + name: Chinook_ExtendedJson + graphql: + typeName: Chinook_ExtendedJson + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: chinook + dataConnectorScalarType: ExtendedJSON + representation: Chinook_ExtendedJson + graphql: + comparisonExpressionTypeName: Chinook_ExtendedJsonComparisonExp diff --git a/fixtures/hasura/chinook/metadata/models/Album.hml b/fixtures/hasura/chinook/metadata/models/Album.hml index a17cf54c..be6847fa 100644 --- a/fixtures/hasura/chinook/metadata/models/Album.hml +++ b/fixtures/hasura/chinook/metadata/models/Album.hml @@ -31,6 +31,7 @@ definition: title: column: name: Title + description: Object type for collection Album --- kind: TypePermissions diff --git a/fixtures/hasura/chinook/metadata/models/Artist.hml b/fixtures/hasura/chinook/metadata/models/Artist.hml index b88dccf6..aadf44bb 100644 --- a/fixtures/hasura/chinook/metadata/models/Artist.hml +++ b/fixtures/hasura/chinook/metadata/models/Artist.hml @@ -9,7 +9,7 @@ definition: - name: artistId type: Int! - name: name - type: String! + type: String graphql: typeName: Artist inputTypeName: ArtistInput @@ -26,6 +26,7 @@ definition: name: column: name: Name + description: Object type for collection Artist --- kind: TypePermissions diff --git a/fixtures/hasura/chinook/metadata/models/Customer.hml b/fixtures/hasura/chinook/metadata/models/Customer.hml index a579f1ca..10233562 100644 --- a/fixtures/hasura/chinook/metadata/models/Customer.hml +++ b/fixtures/hasura/chinook/metadata/models/Customer.hml @@ -7,31 +7,31 @@ definition: - name: id type: Chinook_ObjectId! - name: address - type: String! + type: String - name: city - type: String! + type: String - name: company - type: String! + type: String - name: country - type: String! + type: String - name: customerId type: Int! - name: email type: String! - name: fax - type: String! + type: String - name: firstName type: String! - name: lastName type: String! - name: phone - type: String! + type: String - name: postalCode - type: Chinook_ExtendedJson + type: String - name: state - type: String! + type: String - name: supportRepId - type: Int! + type: Int graphql: typeName: Customer inputTypeName: CustomerInput @@ -81,6 +81,7 @@ definition: supportRepId: column: name: SupportRepId + description: Object type for collection Customer --- kind: TypePermissions diff --git a/fixtures/hasura/chinook/metadata/models/Employee.hml b/fixtures/hasura/chinook/metadata/models/Employee.hml index 5615c097..79af5edb 100644 --- a/fixtures/hasura/chinook/metadata/models/Employee.hml +++ b/fixtures/hasura/chinook/metadata/models/Employee.hml @@ -7,35 +7,35 @@ definition: - name: id type: Chinook_ObjectId! - 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,6 +91,7 @@ definition: title: column: name: Title + description: Object type for collection Employee --- kind: TypePermissions diff --git a/fixtures/hasura/chinook/metadata/models/Genre.hml b/fixtures/hasura/chinook/metadata/models/Genre.hml index 916ab2e1..bdc3cbee 100644 --- a/fixtures/hasura/chinook/metadata/models/Genre.hml +++ b/fixtures/hasura/chinook/metadata/models/Genre.hml @@ -9,7 +9,7 @@ definition: - name: genreId type: Int! - name: name - type: String! + type: String graphql: typeName: Genre inputTypeName: GenreInput @@ -26,6 +26,7 @@ definition: name: column: name: Name + description: Object type for collection Genre --- kind: TypePermissions diff --git a/fixtures/hasura/chinook/metadata/models/Invoice.hml b/fixtures/hasura/chinook/metadata/models/Invoice.hml index 50b6558d..8cd0391a 100644 --- a/fixtures/hasura/chinook/metadata/models/Invoice.hml +++ b/fixtures/hasura/chinook/metadata/models/Invoice.hml @@ -7,15 +7,15 @@ definition: - name: id type: Chinook_ObjectId! - name: billingAddress - type: String! + type: String - name: billingCity - type: String! + type: String - name: billingCountry - type: String! + type: String - name: billingPostalCode - type: Chinook_ExtendedJson + type: String - name: billingState - type: String! + type: String - name: customerId type: Int! - name: invoiceDate @@ -23,7 +23,7 @@ definition: - name: invoiceId type: Int! - name: total - type: Float! + type: Decimal! graphql: typeName: Invoice inputTypeName: InvoiceInput @@ -61,6 +61,7 @@ definition: total: column: name: Total + description: Object type for collection Invoice --- kind: TypePermissions diff --git a/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml b/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml index 39513adc..19d790c9 100644 --- a/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml +++ b/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml @@ -15,7 +15,7 @@ definition: - name: trackId type: Int! - name: unitPrice - type: Float! + type: Decimal! graphql: typeName: InvoiceLine inputTypeName: InvoiceLineInput @@ -41,6 +41,7 @@ definition: unitPrice: column: name: UnitPrice + description: Object type for collection InvoiceLine --- kind: TypePermissions diff --git a/fixtures/hasura/chinook/metadata/models/MediaType.hml b/fixtures/hasura/chinook/metadata/models/MediaType.hml index e01e6657..65c462f7 100644 --- a/fixtures/hasura/chinook/metadata/models/MediaType.hml +++ b/fixtures/hasura/chinook/metadata/models/MediaType.hml @@ -9,7 +9,7 @@ definition: - name: mediaTypeId type: Int! - name: name - type: String! + type: String graphql: typeName: MediaType inputTypeName: MediaTypeInput @@ -26,6 +26,7 @@ definition: name: column: name: Name + description: Object type for collection MediaType --- kind: TypePermissions diff --git a/fixtures/hasura/chinook/metadata/models/Playlist.hml b/fixtures/hasura/chinook/metadata/models/Playlist.hml index 6479bbe4..6e474e8e 100644 --- a/fixtures/hasura/chinook/metadata/models/Playlist.hml +++ b/fixtures/hasura/chinook/metadata/models/Playlist.hml @@ -7,7 +7,7 @@ definition: - name: id type: Chinook_ObjectId! - name: name - type: String! + type: String - name: playlistId type: Int! graphql: @@ -26,6 +26,7 @@ definition: playlistId: column: name: PlaylistId + description: Object type for collection Playlist --- kind: TypePermissions diff --git a/fixtures/hasura/chinook/metadata/models/PlaylistTrack.hml b/fixtures/hasura/chinook/metadata/models/PlaylistTrack.hml index 1ce858c7..ec0efc74 100644 --- a/fixtures/hasura/chinook/metadata/models/PlaylistTrack.hml +++ b/fixtures/hasura/chinook/metadata/models/PlaylistTrack.hml @@ -26,6 +26,7 @@ definition: trackId: column: name: TrackId + description: Object type for collection PlaylistTrack --- kind: TypePermissions diff --git a/fixtures/hasura/chinook/metadata/models/Track.hml b/fixtures/hasura/chinook/metadata/models/Track.hml index 83c8a7ae..3910420c 100644 --- a/fixtures/hasura/chinook/metadata/models/Track.hml +++ b/fixtures/hasura/chinook/metadata/models/Track.hml @@ -7,13 +7,13 @@ definition: - name: id type: Chinook_ObjectId! - name: albumId - type: Int! + type: Int - name: bytes - type: Int! + type: Int - name: composer - type: String! + type: String - name: genreId - type: Int! + type: Int - name: mediaTypeId type: Int! - name: milliseconds @@ -23,7 +23,7 @@ definition: - name: trackId type: Int! - name: unitPrice - type: Float! + type: Decimal! graphql: typeName: Track inputTypeName: TrackInput @@ -61,6 +61,7 @@ definition: unitPrice: column: name: UnitPrice + description: Object type for collection Track --- kind: TypePermissions From 9f235fdd1c69c4f5733eb769c2773551e301be0e Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Tue, 18 Jun 2024 11:41:46 -0700 Subject: [PATCH 20/34] wip: --- crates/mongodb-connector/src/capabilities.rs | 2 +- fixtures/hasura/docker-compose.hasura.yaml | 45 -------------------- fixtures/hasura/engine/metadata.json | 2 +- 3 files changed, 2 insertions(+), 47 deletions(-) delete mode 100644 fixtures/hasura/docker-compose.hasura.yaml diff --git a/crates/mongodb-connector/src/capabilities.rs b/crates/mongodb-connector/src/capabilities.rs index 1129bb8a..1ee78543 100644 --- a/crates/mongodb-connector/src/capabilities.rs +++ b/crates/mongodb-connector/src/capabilities.rs @@ -22,7 +22,7 @@ pub fn mongo_capabilities_response() -> CapabilitiesResponse { explain: None, }, relationships: Some(RelationshipCapabilities { - relation_comparisons: None, + relation_comparisons: Some(LeafCapability {}), order_by_aggregate: None, }), }, diff --git a/fixtures/hasura/docker-compose.hasura.yaml b/fixtures/hasura/docker-compose.hasura.yaml deleted file mode 100644 index 385f5a7d..00000000 --- a/fixtures/hasura/docker-compose.hasura.yaml +++ /dev/null @@ -1,45 +0,0 @@ -services: - auth_hook: - image: ghcr.io/hasura/v3-dev-auth-webhook - engine: - build: - context: engine - dockerfile_inline: |- - FROM ghcr.io/hasura/v3-engine - COPY ./ /md/ - develop: - watch: - - path: engine - action: sync+restart - target: /md/ - depends_on: - auth_hook: - condition: service_started - required: false - env_file: - - .env.engine - extra_hosts: - - local.hasura.dev=host-gateway - platform: linux/amd64 - ports: - - mode: ingress - target: 3000 - published: "3000" - protocol: tcp - otel-collector: - command: - - --config=/etc/otel-collector-config.yaml - environment: - HASURA_DDN_PAT: ${HASURA_DDN_PAT} - image: otel/opentelemetry-collector - ports: - - mode: ingress - target: 4317 - published: "4317" - protocol: tcp - - mode: ingress - target: 4318 - published: "4318" - protocol: tcp - volumes: - - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml diff --git a/fixtures/hasura/engine/metadata.json b/fixtures/hasura/engine/metadata.json index 9760c278..2a181f22 100644 --- a/fixtures/hasura/engine/metadata.json +++ b/fixtures/hasura/engine/metadata.json @@ -1 +1 @@ -{"subgraphs":[],"supergraph":{"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-06-13","kind":"CompatibilityConfig"}]},"version":"v1"} \ No newline at end of file +{"subgraphs":[],"supergraph":{"objects":[{"definition":{"allowRoleEmulationBy":"admin","mode":{"webhook":{"method":"Post","url":"http://auth_hook:3050/validate-request"}}},"kind":"AuthConfig","version":"v1"},{"date":"2024-06-13","kind":"CompatibilityConfig"},{"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"}]},"version":"v1"} \ No newline at end of file From e3a8744b9188244fe3b74f6d7990f73c48f8bd7b Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Tue, 9 Jul 2024 15:53:06 -0700 Subject: [PATCH 21/34] run init with latest cli --- .../hasura/.devcontainer/devcontainer.json | 2 +- fixtures/hasura/engine/.env.engine | 5 ++++ fixtures/hasura/engine/metadata.json | 2 +- fixtures/hasura/engine/open_dd.json | 2 +- .../.env.globals.cloud} | 0 fixtures/hasura/globals/.env.globals.local | 0 fixtures/hasura/globals/auth-config.cloud.hml | 8 +++++++ .../auth-config.local.hml} | 0 .../compatibility-config.hml | 2 +- .../graphql-config.hml | 0 fixtures/hasura/globals/subgraph.cloud.yaml | 11 +++++++++ fixtures/hasura/globals/subgraph.local.yaml | 11 +++++++++ fixtures/hasura/otel-collector-config.yaml | 2 +- fixtures/hasura/supergraph.cloud.yaml | 7 ++++++ fixtures/hasura/supergraph.local.yaml | 7 ++++++ fixtures/hasura/supergraph.yaml | 24 ------------------- 16 files changed, 54 insertions(+), 29 deletions(-) create mode 100644 fixtures/hasura/engine/.env.engine rename fixtures/hasura/{supergraph_globals/.env.supergraph_globals => globals/.env.globals.cloud} (100%) create mode 100644 fixtures/hasura/globals/.env.globals.local create mode 100644 fixtures/hasura/globals/auth-config.cloud.hml rename fixtures/hasura/{supergraph_globals/auth-config.hml => globals/auth-config.local.hml} (100%) rename fixtures/hasura/{supergraph_globals => globals}/compatibility-config.hml (57%) rename fixtures/hasura/{supergraph_globals => globals}/graphql-config.hml (100%) create mode 100644 fixtures/hasura/globals/subgraph.cloud.yaml create mode 100644 fixtures/hasura/globals/subgraph.local.yaml create mode 100644 fixtures/hasura/supergraph.cloud.yaml create mode 100644 fixtures/hasura/supergraph.local.yaml delete mode 100644 fixtures/hasura/supergraph.yaml diff --git a/fixtures/hasura/.devcontainer/devcontainer.json b/fixtures/hasura/.devcontainer/devcontainer.json index c73d191d..ea38082b 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/v1/get.sh | bash" + "postCreateCommand": "curl -L https://graphql-engine-cdn.hasura.io/ddn/cli/v2/get.sh | bash" } diff --git a/fixtures/hasura/engine/.env.engine b/fixtures/hasura/engine/.env.engine new file mode 100644 index 00000000..14d6bfc3 --- /dev/null +++ b/fixtures/hasura/engine/.env.engine @@ -0,0 +1,5 @@ +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/metadata.json b/fixtures/hasura/engine/metadata.json index 2a181f22..84b41230 100644 --- a/fixtures/hasura/engine/metadata.json +++ b/fixtures/hasura/engine/metadata.json @@ -1 +1 @@ -{"subgraphs":[],"supergraph":{"objects":[{"definition":{"allowRoleEmulationBy":"admin","mode":{"webhook":{"method":"Post","url":"http://auth_hook:3050/validate-request"}}},"kind":"AuthConfig","version":"v1"},{"date":"2024-06-13","kind":"CompatibilityConfig"},{"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"}]},"version":"v1"} \ No newline at end of file +{"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 index 93764643..508184df 100644 --- a/fixtures/hasura/engine/open_dd.json +++ b/fixtures/hasura/engine/open_dd.json @@ -1 +1 @@ -{"version":"v2","supergraph":{"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}}]},"subgraphs":[],"flags":{"require_graphql_config":false}} \ No newline at end of file +{"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/supergraph_globals/.env.supergraph_globals b/fixtures/hasura/globals/.env.globals.cloud similarity index 100% rename from fixtures/hasura/supergraph_globals/.env.supergraph_globals rename to fixtures/hasura/globals/.env.globals.cloud diff --git a/fixtures/hasura/globals/.env.globals.local b/fixtures/hasura/globals/.env.globals.local new file mode 100644 index 00000000..e69de29b diff --git a/fixtures/hasura/globals/auth-config.cloud.hml b/fixtures/hasura/globals/auth-config.cloud.hml new file mode 100644 index 00000000..1080ecc3 --- /dev/null +++ b/fixtures/hasura/globals/auth-config.cloud.hml @@ -0,0 +1,8 @@ +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/supergraph_globals/auth-config.hml b/fixtures/hasura/globals/auth-config.local.hml similarity index 100% rename from fixtures/hasura/supergraph_globals/auth-config.hml rename to fixtures/hasura/globals/auth-config.local.hml diff --git a/fixtures/hasura/supergraph_globals/compatibility-config.hml b/fixtures/hasura/globals/compatibility-config.hml similarity index 57% rename from fixtures/hasura/supergraph_globals/compatibility-config.hml rename to fixtures/hasura/globals/compatibility-config.hml index 4964e455..80856ac1 100644 --- a/fixtures/hasura/supergraph_globals/compatibility-config.hml +++ b/fixtures/hasura/globals/compatibility-config.hml @@ -1,2 +1,2 @@ kind: CompatibilityConfig -date: "2024-06-13" +date: "2024-07-09" diff --git a/fixtures/hasura/supergraph_globals/graphql-config.hml b/fixtures/hasura/globals/graphql-config.hml similarity index 100% rename from fixtures/hasura/supergraph_globals/graphql-config.hml rename to fixtures/hasura/globals/graphql-config.hml diff --git a/fixtures/hasura/globals/subgraph.cloud.yaml b/fixtures/hasura/globals/subgraph.cloud.yaml new file mode 100644 index 00000000..dea2c3d4 --- /dev/null +++ b/fixtures/hasura/globals/subgraph.cloud.yaml @@ -0,0 +1,11 @@ +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 new file mode 100644 index 00000000..d5e4d000 --- /dev/null +++ b/fixtures/hasura/globals/subgraph.local.yaml @@ -0,0 +1,11 @@ +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/otel-collector-config.yaml b/fixtures/hasura/otel-collector-config.yaml index c2955fc5..fa4a879e 100644 --- a/fixtures/hasura/otel-collector-config.yaml +++ b/fixtures/hasura/otel-collector-config.yaml @@ -1,6 +1,6 @@ exporters: otlp: - endpoint: https://gateway.otlp.arusah.com:443 + endpoint: https://gateway.otlp.hasura.io:443 headers: Authorization: pat ${env:HASURA_DDN_PAT} processors: diff --git a/fixtures/hasura/supergraph.cloud.yaml b/fixtures/hasura/supergraph.cloud.yaml new file mode 100644 index 00000000..2e63fc09 --- /dev/null +++ b/fixtures/hasura/supergraph.cloud.yaml @@ -0,0 +1,7 @@ +kind: Supergraph +version: v2 +definition: + subgraphs: + - globals/subgraph.cloud.yaml + - chinook/subgraph.cloud.yaml + - sample_mflix/subgraph.cloud.yaml diff --git a/fixtures/hasura/supergraph.local.yaml b/fixtures/hasura/supergraph.local.yaml new file mode 100644 index 00000000..94840e70 --- /dev/null +++ b/fixtures/hasura/supergraph.local.yaml @@ -0,0 +1,7 @@ +kind: Supergraph +version: v2 +definition: + subgraphs: + - globals/subgraph.local.yaml + - chinook/subgraph.local.yaml + - sample_mflix/subgraph.local.yaml diff --git a/fixtures/hasura/supergraph.yaml b/fixtures/hasura/supergraph.yaml deleted file mode 100644 index 5b311c3f..00000000 --- a/fixtures/hasura/supergraph.yaml +++ /dev/null @@ -1,24 +0,0 @@ -kind: Supergraph -version: v1 -definition: - supergraph_globals: - generator: - rootPath: ./supergraph_globals - envFile: ./supergraph_globals/.env.supergraph_globals - includePaths: - - ./supergraph_globals/auth-config.hml - - ./supergraph_globals/compatibility-config.hml - - ./supergraph_globals/graphql-config.hml - subgraphs: - chinook: - generator: - rootPath: chinook - envFile: chinook/.env.chinook - includePaths: - - chinook - sample_mflix: - generator: - rootPath: sample_mflix - envFile: sample_mflix/.env.sample_mflix - includePaths: - - sample_mflix From a49e53665c602b10e749b0798ea84a613ef705cb Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Tue, 9 Jul 2024 17:01:32 -0700 Subject: [PATCH 22/34] more updates for latest cli --- fixtures/hasura/chinook/connector/chinook/.ddnignore | 1 + fixtures/hasura/chinook/connector/chinook/.env.cloud | 3 +++ .../chinook/{connector.yaml => connector.cloud.yaml} | 2 +- .../hasura/chinook/connector/chinook/connector.local.yaml | 8 ++++++++ fixtures/hasura/chinook/subgraph.yaml | 8 ++++++++ .../{.env.sample_mflix => .env.sample_mflix.cloud} | 0 fixtures/hasura/sample_mflix/.env.sample_mflix.local | 1 + .../hasura/sample_mflix/connector/sample_mflix/.ddnignore | 1 + .../hasura/sample_mflix/connector/sample_mflix/.env.cloud | 3 +++ .../connector/sample_mflix/connector.cloud.yaml | 8 ++++++++ .../sample_mflix/{connector.yaml => connector.local.yaml} | 2 +- fixtures/hasura/sample_mflix/subgraph.yaml | 8 ++++++++ 12 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 fixtures/hasura/chinook/connector/chinook/.env.cloud rename fixtures/hasura/chinook/connector/chinook/{connector.yaml => connector.cloud.yaml} (77%) create mode 100644 fixtures/hasura/chinook/connector/chinook/connector.local.yaml create mode 100644 fixtures/hasura/chinook/subgraph.yaml rename fixtures/hasura/sample_mflix/{.env.sample_mflix => .env.sample_mflix.cloud} (100%) create mode 100644 fixtures/hasura/sample_mflix/.env.sample_mflix.local create mode 100644 fixtures/hasura/sample_mflix/connector/sample_mflix/.env.cloud create mode 100644 fixtures/hasura/sample_mflix/connector/sample_mflix/connector.cloud.yaml rename fixtures/hasura/sample_mflix/connector/sample_mflix/{connector.yaml => connector.local.yaml} (79%) create mode 100644 fixtures/hasura/sample_mflix/subgraph.yaml diff --git a/fixtures/hasura/chinook/connector/chinook/.ddnignore b/fixtures/hasura/chinook/connector/chinook/.ddnignore index e69de29b..3615120b 100644 --- a/fixtures/hasura/chinook/connector/chinook/.ddnignore +++ b/fixtures/hasura/chinook/connector/chinook/.ddnignore @@ -0,0 +1 @@ +.env.* diff --git a/fixtures/hasura/chinook/connector/chinook/.env.cloud b/fixtures/hasura/chinook/connector/chinook/.env.cloud new file mode 100644 index 00000000..7f6640d6 --- /dev/null +++ b/fixtures/hasura/chinook/connector/chinook/.env.cloud @@ -0,0 +1,3 @@ +OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://local.hasura.dev:4317 +OTEL_SERVICE_NAME=chinook_chinook +MONGODB_DATABASE_URI="mongodb://localhost/chinook" diff --git a/fixtures/hasura/chinook/connector/chinook/connector.yaml b/fixtures/hasura/chinook/connector/chinook/connector.cloud.yaml similarity index 77% rename from fixtures/hasura/chinook/connector/chinook/connector.yaml rename to fixtures/hasura/chinook/connector/chinook/connector.cloud.yaml index c41e013a..786b857e 100644 --- a/fixtures/hasura/chinook/connector/chinook/connector.yaml +++ b/fixtures/hasura/chinook/connector/chinook/connector.cloud.yaml @@ -3,6 +3,6 @@ version: v1 definition: name: chinook subgraph: chinook - source: hasura/mongodb:v0.0.6 + source: hasura/mongodb:v0.1.0 context: . envFile: .env.local diff --git a/fixtures/hasura/chinook/connector/chinook/connector.local.yaml b/fixtures/hasura/chinook/connector/chinook/connector.local.yaml new file mode 100644 index 00000000..786b857e --- /dev/null +++ b/fixtures/hasura/chinook/connector/chinook/connector.local.yaml @@ -0,0 +1,8 @@ +kind: Connector +version: v1 +definition: + name: chinook + subgraph: chinook + source: hasura/mongodb:v0.1.0 + context: . + envFile: .env.local diff --git a/fixtures/hasura/chinook/subgraph.yaml b/fixtures/hasura/chinook/subgraph.yaml new file mode 100644 index 00000000..fef4fcb2 --- /dev/null +++ b/fixtures/hasura/chinook/subgraph.yaml @@ -0,0 +1,8 @@ +kind: Subgraph +version: v1 +definition: + generator: + rootPath: . + includePaths: + - metadata + name: chinook diff --git a/fixtures/hasura/sample_mflix/.env.sample_mflix b/fixtures/hasura/sample_mflix/.env.sample_mflix.cloud similarity index 100% rename from fixtures/hasura/sample_mflix/.env.sample_mflix rename to fixtures/hasura/sample_mflix/.env.sample_mflix.cloud diff --git a/fixtures/hasura/sample_mflix/.env.sample_mflix.local b/fixtures/hasura/sample_mflix/.env.sample_mflix.local new file mode 100644 index 00000000..e003fd5a --- /dev/null +++ b/fixtures/hasura/sample_mflix/.env.sample_mflix.local @@ -0,0 +1 @@ +SAMPLE_MFLIX_CONNECTOR_URL='http://localhost:7130' diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/.ddnignore b/fixtures/hasura/sample_mflix/connector/sample_mflix/.ddnignore index e69de29b..81a38be6 100644 --- a/fixtures/hasura/sample_mflix/connector/sample_mflix/.ddnignore +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/.ddnignore @@ -0,0 +1 @@ +.env* diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/.env.cloud b/fixtures/hasura/sample_mflix/connector/sample_mflix/.env.cloud new file mode 100644 index 00000000..884073bf --- /dev/null +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/.env.cloud @@ -0,0 +1,3 @@ +OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://local.hasura.dev:4317 +OTEL_SERVICE_NAME=sample_mflix_sample_mflix +MONGODB_DATABASE_URI="mongodb://localhost/sample_mflix" diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/connector.cloud.yaml b/fixtures/hasura/sample_mflix/connector/sample_mflix/connector.cloud.yaml new file mode 100644 index 00000000..8d69912c --- /dev/null +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/connector.cloud.yaml @@ -0,0 +1,8 @@ +kind: Connector +version: v1 +definition: + name: sample_mflix + subgraph: sample_mflix + source: hasura/mongodb:v0.1.0 + context: . + envFile: .env.cloud diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/connector.yaml b/fixtures/hasura/sample_mflix/connector/sample_mflix/connector.local.yaml similarity index 79% rename from fixtures/hasura/sample_mflix/connector/sample_mflix/connector.yaml rename to fixtures/hasura/sample_mflix/connector/sample_mflix/connector.local.yaml index 59076a56..8407afbb 100644 --- a/fixtures/hasura/sample_mflix/connector/sample_mflix/connector.yaml +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/connector.local.yaml @@ -3,6 +3,6 @@ version: v1 definition: name: sample_mflix subgraph: sample_mflix - source: hasura/mongodb:v0.0.6 + source: hasura/mongodb:v0.1.0 context: . envFile: .env.local diff --git a/fixtures/hasura/sample_mflix/subgraph.yaml b/fixtures/hasura/sample_mflix/subgraph.yaml new file mode 100644 index 00000000..6b571d44 --- /dev/null +++ b/fixtures/hasura/sample_mflix/subgraph.yaml @@ -0,0 +1,8 @@ +kind: Subgraph +version: v1 +definition: + generator: + rootPath: . + includePaths: + - metadata + name: sample_mflix From 5e8cef8eaad39b0cabf60df073e241db5e7058b1 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Tue, 9 Jul 2024 17:22:03 -0700 Subject: [PATCH 23/34] pull ddn updates for sample_mflix --- fixtures/hasura/README.md | 33 +++++++++++++++ .../sample_mflix-types.hml | 28 ++++++++----- .../{dataconnectors => }/sample_mflix.hml | 40 ++----------------- 3 files changed, 56 insertions(+), 45 deletions(-) create mode 100644 fixtures/hasura/README.md rename fixtures/hasura/sample_mflix/metadata/{dataconnectors => }/sample_mflix-types.hml (93%) rename fixtures/hasura/sample_mflix/metadata/{dataconnectors => }/sample_mflix.hml (96%) diff --git a/fixtures/hasura/README.md b/fixtures/hasura/README.md new file mode 100644 index 00000000..2d155360 --- /dev/null +++ b/fixtures/hasura/README.md @@ -0,0 +1,33 @@ +# MongoDB Connector Hasura fixtures + +This directory contains example DDN and connector configuration which is used to +run integration tests in this repo, and supports local development. + +Instead of having docker compose configurations in this directory, supporting +services are run using arion configurations defined at the top level of the +repo. Before running ddn commands bring up services with: + +```sh +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. + +Run introspection to update connector configuration: + +```sh +$ ddn connector introspect --connector sample_mflix/connector/sample_mflix/connector.local.yaml + +$ ddn connector introspect --connector chinook/connector/chinook/connector.local.yaml +``` + +Update ddn based on connector configuration: + +```sh +$ ddn connector-link update sample_mflix --subgraph sample_mflix/subgraph.yaml --env-file sample_mflix/.env.sample_mflix.local --add-all-resources + +$ ddn connector-link update chinook --subgraph chinook/subgraph.yaml --env-file chinook/.env.chinook.local --add-all-resources +``` diff --git a/fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix-types.hml b/fixtures/hasura/sample_mflix/metadata/sample_mflix-types.hml similarity index 93% rename from fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix-types.hml rename to fixtures/hasura/sample_mflix/metadata/sample_mflix-types.hml index b14b2b65..423f0a71 100644 --- a/fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix-types.hml +++ b/fixtures/hasura/sample_mflix/metadata/sample_mflix-types.hml @@ -6,14 +6,6 @@ definition: graphql: typeName: ObjectId ---- -kind: ScalarType -version: v1 -definition: - name: Date - graphql: - typeName: Date - --- kind: DataConnectorScalarRepresentation version: v1 @@ -24,6 +16,14 @@ definition: graphql: comparisonExpressionTypeName: ObjectIdComparisonExp +--- +kind: ScalarType +version: v1 +definition: + name: Date + graphql: + typeName: Date + --- kind: DataConnectorScalarRepresentation version: v1 @@ -72,12 +72,22 @@ definition: graphql: comparisonExpressionTypeName: ExtendedJsonComparisonExp +--- +kind: ScalarType +version: v1 +definition: + name: Double + graphql: + typeName: Double + --- kind: DataConnectorScalarRepresentation version: v1 definition: dataConnectorName: sample_mflix dataConnectorScalarType: Double - representation: Float + representation: Double graphql: comparisonExpressionTypeName: DoubleComparisonExp + + diff --git a/fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix.hml b/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml similarity index 96% rename from fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix.hml rename to fixtures/hasura/sample_mflix/metadata/sample_mflix.hml index a984caca..133c190c 100644 --- a/fixtures/hasura/sample_mflix/metadata/dataconnectors/sample_mflix.hml +++ b/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml @@ -517,22 +517,6 @@ definition: type: named name: Undefined object_types: - Hello: - fields: - __value: - type: - type: named - name: String - TitleWordFrequency: - fields: - _id: - type: - type: named - name: String - count: - type: - type: named - name: Int comments: fields: _id: @@ -914,15 +898,6 @@ definition: unique_columns: - _id foreign_keys: {} - - name: title_word_frequency - description: words appearing in movie titles with counts - arguments: {} - type: TitleWordFrequency - uniqueness_constraints: - title_word_frequency_id: - unique_columns: - - _id - foreign_keys: {} - name: users arguments: {} type: users @@ -931,17 +906,7 @@ definition: unique_columns: - _id foreign_keys: {} - functions: - - name: hello - description: Basic test of native queries - arguments: - name: - type: - type: named - name: String - result_type: - type: named - name: String + functions: [] procedures: [] capabilities: version: 0.1.4 @@ -950,6 +915,9 @@ definition: aggregates: {} variables: {} explain: {} + nested_fields: + filter_by: {} + order_by: {} mutation: {} relationships: relation_comparisons: {} From a24af0a11528abb2ca114ba3d04cc7d01f7ed5dd Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Tue, 9 Jul 2024 17:24:20 -0700 Subject: [PATCH 24/34] ddn updates for chinook --- .../chinook/{.env.chinook => .env.chinook.local} | 0 .../metadata/{dataconnectors => }/chinook-types.hml | 11 ++++++++++- .../chinook/metadata/{dataconnectors => }/chinook.hml | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) rename fixtures/hasura/chinook/{.env.chinook => .env.chinook.local} (100%) rename fixtures/hasura/chinook/metadata/{dataconnectors => }/chinook-types.hml (93%) rename fixtures/hasura/chinook/metadata/{dataconnectors => }/chinook.hml (99%) diff --git a/fixtures/hasura/chinook/.env.chinook b/fixtures/hasura/chinook/.env.chinook.local similarity index 100% rename from fixtures/hasura/chinook/.env.chinook rename to fixtures/hasura/chinook/.env.chinook.local diff --git a/fixtures/hasura/chinook/metadata/dataconnectors/chinook-types.hml b/fixtures/hasura/chinook/metadata/chinook-types.hml similarity index 93% rename from fixtures/hasura/chinook/metadata/dataconnectors/chinook-types.hml rename to fixtures/hasura/chinook/metadata/chinook-types.hml index e3e39566..25ed53ab 100644 --- a/fixtures/hasura/chinook/metadata/dataconnectors/chinook-types.hml +++ b/fixtures/hasura/chinook/metadata/chinook-types.hml @@ -26,13 +26,21 @@ definition: graphql: comparisonExpressionTypeName: Chinook_IntComparisonExp +--- +kind: ScalarType +version: v1 +definition: + name: Double + graphql: + typeName: Chinook_Double + --- kind: DataConnectorScalarRepresentation version: v1 definition: dataConnectorName: chinook dataConnectorScalarType: Double - representation: Float + representation: Double graphql: comparisonExpressionTypeName: Chinook_DoubleComparisonExp @@ -81,3 +89,4 @@ definition: representation: Chinook_ExtendedJson graphql: comparisonExpressionTypeName: Chinook_ExtendedJsonComparisonExp + diff --git a/fixtures/hasura/chinook/metadata/dataconnectors/chinook.hml b/fixtures/hasura/chinook/metadata/chinook.hml similarity index 99% rename from fixtures/hasura/chinook/metadata/dataconnectors/chinook.hml rename to fixtures/hasura/chinook/metadata/chinook.hml index 487f72a4..86f633b4 100644 --- a/fixtures/hasura/chinook/metadata/dataconnectors/chinook.hml +++ b/fixtures/hasura/chinook/metadata/chinook.hml @@ -1040,6 +1040,9 @@ definition: aggregates: {} variables: {} explain: {} + nested_fields: + filter_by: {} + order_by: {} mutation: {} relationships: relation_comparisons: {} From 87b2fd2df012fb7523b5eaeb2db7e20e6eb001f9 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Tue, 9 Jul 2024 17:35:55 -0700 Subject: [PATCH 25/34] update arion to point to new fixtures --- arion-compose/e2e-testing.nix | 4 +- arion-compose/integration-test-services.nix | 10 ++--- arion-compose/ndc-test.nix | 2 +- arion-compose/services/connector.nix | 2 +- arion-compose/services/engine.nix | 2 +- .../sample_mflix/metadata/sample_mflix.hml | 37 ++++++++++++++++++- 6 files changed, 46 insertions(+), 11 deletions(-) diff --git a/arion-compose/e2e-testing.nix b/arion-compose/e2e-testing.nix index 745b3f5c..2c2822c2 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/connector/chinook; + configuration-dir = ../fixtures/hasura/chinook/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/ddn/chinook ]; + ddn-dirs = [ ../fixtures/hasura/chinook/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 48f81327..bcf3617a 100644 --- a/arion-compose/integration-test-services.nix +++ b/arion-compose/integration-test-services.nix @@ -21,7 +21,7 @@ in { connector = import ./services/connector.nix { inherit pkgs otlp-endpoint; - configuration-dir = ../fixtures/connector/sample_mflix; + configuration-dir = ../fixtures/hasura/sample_mflix/connector/sample_mflix; database-uri = "mongodb://mongodb/sample_mflix"; port = connector-port; hostPort = hostPort connector-port; @@ -32,7 +32,7 @@ in connector-chinook = import ./services/connector.nix { inherit pkgs otlp-endpoint; - configuration-dir = ../fixtures/connector/chinook; + configuration-dir = ../fixtures/hasura/chinook/connector/chinook; database-uri = "mongodb://mongodb/chinook"; port = connector-chinook-port; hostPort = hostPort connector-chinook-port; @@ -62,9 +62,9 @@ in sample_mflix = "http://connector:${connector-port}"; }; ddn-dirs = [ - ../fixtures/ddn/chinook - ../fixtures/ddn/sample_mflix - ../fixtures/ddn/remote-relationships_chinook-sample_mflix + ../fixtures/hasura/chinook/metadata + ../fixtures/hasura/sample_mflix/metadata + # ../fixtures/ddn/remote-relationships_chinook-sample_mflix ]; service.depends_on = { auth-hook.condition = "service_started"; diff --git a/arion-compose/ndc-test.nix b/arion-compose/ndc-test.nix index eb1d6bf3..4f39e3b7 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/connector/chinook; + configuration-dir = ../fixtures/hasura/chinook/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 8c87042b..a65e2c7e 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/connector/sample_mflix +, configuration-dir ? ../../fixtures/hasura/sample_mflix/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 d39f5f9e..b520948b 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/ddn/subgraphs/sample_mflix ] +, ddn-dirs ? [ ../../fixtures/hasura/sample_mflix/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/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml b/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml index 133c190c..e3d3f74b 100644 --- a/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml +++ b/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml @@ -517,6 +517,22 @@ definition: type: named name: Undefined object_types: + Hello: + fields: + __value: + type: + type: named + name: String + TitleWordFrequency: + fields: + _id: + type: + type: named + name: String + count: + type: + type: named + name: Int comments: fields: _id: @@ -898,6 +914,15 @@ definition: unique_columns: - _id foreign_keys: {} + - name: title_word_frequency + description: words appearing in movie titles with counts + arguments: {} + type: TitleWordFrequency + uniqueness_constraints: + title_word_frequency_id: + unique_columns: + - _id + foreign_keys: {} - name: users arguments: {} type: users @@ -906,7 +931,17 @@ definition: unique_columns: - _id foreign_keys: {} - functions: [] + functions: + - name: hello + description: Basic test of native queries + arguments: + name: + type: + type: named + name: String + result_type: + type: named + name: String procedures: [] capabilities: version: 0.1.4 From 9d1bcf1faeffa3ddbed653d46b19bba9883bb016 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Tue, 9 Jul 2024 17:49:36 -0700 Subject: [PATCH 26/34] only one Double! --- fixtures/hasura/chinook/metadata/chinook-types.hml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fixtures/hasura/chinook/metadata/chinook-types.hml b/fixtures/hasura/chinook/metadata/chinook-types.hml index 25ed53ab..8a8c6de0 100644 --- a/fixtures/hasura/chinook/metadata/chinook-types.hml +++ b/fixtures/hasura/chinook/metadata/chinook-types.hml @@ -30,7 +30,7 @@ definition: kind: ScalarType version: v1 definition: - name: Double + name: Chinook_Double graphql: typeName: Chinook_Double From 360950ac76c4232f82f37a65b5d8b664ffacd4c4 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Tue, 9 Jul 2024 18:02:49 -0700 Subject: [PATCH 27/34] set up remote relationship --- arion-compose/integration-test-services.nix | 2 +- .../metadata/relationships/album_movie.hml | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 fixtures/hasura/common/metadata/relationships/album_movie.hml diff --git a/arion-compose/integration-test-services.nix b/arion-compose/integration-test-services.nix index bcf3617a..1d6b7921 100644 --- a/arion-compose/integration-test-services.nix +++ b/arion-compose/integration-test-services.nix @@ -64,7 +64,7 @@ in ddn-dirs = [ ../fixtures/hasura/chinook/metadata ../fixtures/hasura/sample_mflix/metadata - # ../fixtures/ddn/remote-relationships_chinook-sample_mflix + ../fixtures/hasura/common/metadata ]; service.depends_on = { auth-hook.condition = "service_started"; diff --git a/fixtures/hasura/common/metadata/relationships/album_movie.hml b/fixtures/hasura/common/metadata/relationships/album_movie.hml new file mode 100644 index 00000000..10d0bdf3 --- /dev/null +++ b/fixtures/hasura/common/metadata/relationships/album_movie.hml @@ -0,0 +1,17 @@ +# This is not a meaningful relationship, but it gives us something to test with. +kind: Relationship +version: v1 +definition: + name: movies + source: Album + target: + model: + name: Movies + relationshipType: Array + mapping: + - source: + fieldPath: + - fieldName: albumId + target: + modelField: + - fieldName: runtime From 628b5c4871c6661d02846a260e190ce29d91e4b4 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Tue, 9 Jul 2024 18:04:05 -0700 Subject: [PATCH 28/34] remove old fixtures --- .../native_mutations/insert_artist.json | 44 - fixtures/connector/chinook/schema/Album.json | 35 - fixtures/connector/chinook/schema/Artist.json | 32 - .../connector/chinook/schema/Customer.json | 103 -- .../connector/chinook/schema/Employee.json | 119 --- fixtures/connector/chinook/schema/Genre.json | 32 - .../connector/chinook/schema/Invoice.json | 75 -- .../connector/chinook/schema/InvoiceLine.json | 45 - .../connector/chinook/schema/MediaType.json | 32 - .../connector/chinook/schema/Playlist.json | 32 - .../chinook/schema/PlaylistTrack.json | 30 - fixtures/connector/chinook/schema/Track.json | 73 -- .../sample_mflix/schema/comments.json | 44 - .../connector/sample_mflix/schema/movies.json | 296 ------ .../sample_mflix/schema/sessions.json | 29 - .../sample_mflix/schema/theaters.json | 90 -- .../connector/sample_mflix/schema/users.json | 34 - fixtures/ddn/chinook/commands/.gitkeep | 0 .../ddn/chinook/commands/InsertArtist.hml | 61 -- fixtures/ddn/chinook/dataconnectors/.gitkeep | 0 .../chinook/dataconnectors/chinook-types.hml | 65 -- .../ddn/chinook/dataconnectors/chinook.hml | 939 ------------------ fixtures/ddn/chinook/models/Album.hml | 114 --- fixtures/ddn/chinook/models/Artist.hml | 102 -- fixtures/ddn/chinook/models/Customer.hml | 234 ----- fixtures/ddn/chinook/models/Employee.hml | 258 ----- fixtures/ddn/chinook/models/Genre.hml | 102 -- fixtures/ddn/chinook/models/Invoice.hml | 186 ---- fixtures/ddn/chinook/models/InvoiceLine.hml | 138 --- fixtures/ddn/chinook/models/MediaType.hml | 102 -- fixtures/ddn/chinook/models/Playlist.hml | 102 -- fixtures/ddn/chinook/models/PlaylistTrack.hml | 102 -- fixtures/ddn/chinook/models/Track.hml | 186 ---- .../chinook/relationships/album_tracks.hml | 34 - .../chinook/relationships/artist_albums.hml | 34 - .../relationships/customer_invoices.hml | 34 - .../relationships/employee_customers.hml | 34 - .../relationships/employee_employees.hml | 34 - .../chinook/relationships/genre_tracks.hml | 34 - .../chinook/relationships/invoice_lines.hml | 34 - .../relationships/media_type_tracks.hml | 34 - .../chinook/relationships/playlist_tracks.hml | 70 -- .../relationships/track_invoice_lines.hml | 34 - .../album_movie.hml | 17 - fixtures/ddn/sample_mflix/commands/Hello.hml | 27 - .../ddn/sample_mflix/dataconnectors/.gitkeep | 0 .../dataconnectors/sample_mflix-types.hml | 83 -- .../dataconnectors/sample_mflix.hml | 921 ----------------- fixtures/ddn/sample_mflix/models/Comments.hml | 157 --- fixtures/ddn/sample_mflix/models/Movies.hml | 511 ---------- fixtures/ddn/sample_mflix/models/Sessions.hml | 102 -- fixtures/ddn/sample_mflix/models/Theaters.hml | 198 ---- .../models/TitleWordFrequency.hml | 90 -- fixtures/ddn/sample_mflix/models/Users.hml | 127 --- .../relationships/movie_comments.hml | 35 - .../relationships/user_comments.hml | 34 - 56 files changed, 6514 deletions(-) delete mode 100644 fixtures/connector/chinook/native_mutations/insert_artist.json delete mode 100644 fixtures/connector/chinook/schema/Album.json delete mode 100644 fixtures/connector/chinook/schema/Artist.json delete mode 100644 fixtures/connector/chinook/schema/Customer.json delete mode 100644 fixtures/connector/chinook/schema/Employee.json delete mode 100644 fixtures/connector/chinook/schema/Genre.json delete mode 100644 fixtures/connector/chinook/schema/Invoice.json delete mode 100644 fixtures/connector/chinook/schema/InvoiceLine.json delete mode 100644 fixtures/connector/chinook/schema/MediaType.json delete mode 100644 fixtures/connector/chinook/schema/Playlist.json delete mode 100644 fixtures/connector/chinook/schema/PlaylistTrack.json delete mode 100644 fixtures/connector/chinook/schema/Track.json delete mode 100644 fixtures/connector/sample_mflix/schema/comments.json delete mode 100644 fixtures/connector/sample_mflix/schema/movies.json delete mode 100644 fixtures/connector/sample_mflix/schema/sessions.json delete mode 100644 fixtures/connector/sample_mflix/schema/theaters.json delete mode 100644 fixtures/connector/sample_mflix/schema/users.json delete mode 100644 fixtures/ddn/chinook/commands/.gitkeep delete mode 100644 fixtures/ddn/chinook/commands/InsertArtist.hml delete mode 100644 fixtures/ddn/chinook/dataconnectors/.gitkeep delete mode 100644 fixtures/ddn/chinook/dataconnectors/chinook-types.hml delete mode 100644 fixtures/ddn/chinook/dataconnectors/chinook.hml delete mode 100644 fixtures/ddn/chinook/models/Album.hml delete mode 100644 fixtures/ddn/chinook/models/Artist.hml delete mode 100644 fixtures/ddn/chinook/models/Customer.hml delete mode 100644 fixtures/ddn/chinook/models/Employee.hml delete mode 100644 fixtures/ddn/chinook/models/Genre.hml delete mode 100644 fixtures/ddn/chinook/models/Invoice.hml delete mode 100644 fixtures/ddn/chinook/models/InvoiceLine.hml delete mode 100644 fixtures/ddn/chinook/models/MediaType.hml delete mode 100644 fixtures/ddn/chinook/models/Playlist.hml delete mode 100644 fixtures/ddn/chinook/models/PlaylistTrack.hml delete mode 100644 fixtures/ddn/chinook/models/Track.hml delete mode 100644 fixtures/ddn/chinook/relationships/album_tracks.hml delete mode 100644 fixtures/ddn/chinook/relationships/artist_albums.hml delete mode 100644 fixtures/ddn/chinook/relationships/customer_invoices.hml delete mode 100644 fixtures/ddn/chinook/relationships/employee_customers.hml delete mode 100644 fixtures/ddn/chinook/relationships/employee_employees.hml delete mode 100644 fixtures/ddn/chinook/relationships/genre_tracks.hml delete mode 100644 fixtures/ddn/chinook/relationships/invoice_lines.hml delete mode 100644 fixtures/ddn/chinook/relationships/media_type_tracks.hml delete mode 100644 fixtures/ddn/chinook/relationships/playlist_tracks.hml delete mode 100644 fixtures/ddn/chinook/relationships/track_invoice_lines.hml delete mode 100644 fixtures/ddn/remote-relationships_chinook-sample_mflix/album_movie.hml delete mode 100644 fixtures/ddn/sample_mflix/commands/Hello.hml delete mode 100644 fixtures/ddn/sample_mflix/dataconnectors/.gitkeep delete mode 100644 fixtures/ddn/sample_mflix/dataconnectors/sample_mflix-types.hml delete mode 100644 fixtures/ddn/sample_mflix/dataconnectors/sample_mflix.hml delete mode 100644 fixtures/ddn/sample_mflix/models/Comments.hml delete mode 100644 fixtures/ddn/sample_mflix/models/Movies.hml delete mode 100644 fixtures/ddn/sample_mflix/models/Sessions.hml delete mode 100644 fixtures/ddn/sample_mflix/models/Theaters.hml delete mode 100644 fixtures/ddn/sample_mflix/models/TitleWordFrequency.hml delete mode 100644 fixtures/ddn/sample_mflix/models/Users.hml delete mode 100644 fixtures/ddn/sample_mflix/relationships/movie_comments.hml delete mode 100644 fixtures/ddn/sample_mflix/relationships/user_comments.hml diff --git a/fixtures/connector/chinook/native_mutations/insert_artist.json b/fixtures/connector/chinook/native_mutations/insert_artist.json deleted file mode 100644 index d9e6051d..00000000 --- a/fixtures/connector/chinook/native_mutations/insert_artist.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "insertArtist", - "description": "Example of a database update using a native mutation", - "resultType": { - "object": "InsertArtist" - }, - "arguments": { - "id": { - "type": { - "scalar": "int" - } - }, - "name": { - "type": { - "scalar": "string" - } - } - }, - "objectTypes": { - "InsertArtist": { - "fields": { - "ok": { - "type": { - "scalar": "double" - } - }, - "n": { - "type": { - "scalar": "int" - } - } - } - } - }, - "command": { - "insert": "Artist", - "documents": [ - { - "ArtistId": "{{ id }}", - "Name": "{{ name }}" - } - ] - } -} diff --git a/fixtures/connector/chinook/schema/Album.json b/fixtures/connector/chinook/schema/Album.json deleted file mode 100644 index a8e61389..00000000 --- a/fixtures/connector/chinook/schema/Album.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "Album", - "collections": { - "Album": { - "type": "Album" - } - }, - "objectTypes": { - "Album": { - "fields": { - "AlbumId": { - "type": { - "scalar": "int" - } - }, - "ArtistId": { - "type": { - "scalar": "int" - } - }, - "Title": { - "type": { - "scalar": "string" - } - }, - "_id": { - "type": { - "scalar": "objectId" - } - } - }, - "description": "Object type for collection Album" - } - } -} diff --git a/fixtures/connector/chinook/schema/Artist.json b/fixtures/connector/chinook/schema/Artist.json deleted file mode 100644 index d60bb483..00000000 --- a/fixtures/connector/chinook/schema/Artist.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "Artist", - "collections": { - "Artist": { - "type": "Artist" - } - }, - "objectTypes": { - "Artist": { - "fields": { - "ArtistId": { - "type": { - "scalar": "int" - } - }, - "Name": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "_id": { - "type": { - "scalar": "objectId" - } - } - }, - "description": "Object type for collection Artist" - } - } -} diff --git a/fixtures/connector/chinook/schema/Customer.json b/fixtures/connector/chinook/schema/Customer.json deleted file mode 100644 index 50dbf947..00000000 --- a/fixtures/connector/chinook/schema/Customer.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "name": "Customer", - "collections": { - "Customer": { - "type": "Customer" - } - }, - "objectTypes": { - "Customer": { - "fields": { - "Address": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "City": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "Company": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "Country": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "CustomerId": { - "type": { - "scalar": "int" - } - }, - "Email": { - "type": { - "scalar": "string" - } - }, - "Fax": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "FirstName": { - "type": { - "scalar": "string" - } - }, - "LastName": { - "type": { - "scalar": "string" - } - }, - "Phone": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "PostalCode": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "State": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "SupportRepId": { - "type": { - "nullable": { - "scalar": "int" - } - } - }, - "_id": { - "type": { - "scalar": "objectId" - } - } - }, - "description": "Object type for collection Customer" - } - } -} diff --git a/fixtures/connector/chinook/schema/Employee.json b/fixtures/connector/chinook/schema/Employee.json deleted file mode 100644 index d6a0524e..00000000 --- a/fixtures/connector/chinook/schema/Employee.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "name": "Employee", - "collections": { - "Employee": { - "type": "Employee" - } - }, - "objectTypes": { - "Employee": { - "fields": { - "Address": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "BirthDate": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "City": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "Country": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "Email": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "EmployeeId": { - "type": { - "scalar": "int" - } - }, - "Fax": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "FirstName": { - "type": { - "scalar": "string" - } - }, - "HireDate": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "LastName": { - "type": { - "scalar": "string" - } - }, - "Phone": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "PostalCode": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "ReportsTo": { - "type": { - "nullable": { - "scalar": "int" - } - } - }, - "State": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "Title": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "_id": { - "type": { - "scalar": "objectId" - } - } - }, - "description": "Object type for collection Employee" - } - } -} diff --git a/fixtures/connector/chinook/schema/Genre.json b/fixtures/connector/chinook/schema/Genre.json deleted file mode 100644 index 99cdb709..00000000 --- a/fixtures/connector/chinook/schema/Genre.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "Genre", - "collections": { - "Genre": { - "type": "Genre" - } - }, - "objectTypes": { - "Genre": { - "fields": { - "GenreId": { - "type": { - "scalar": "int" - } - }, - "Name": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "_id": { - "type": { - "scalar": "objectId" - } - } - }, - "description": "Object type for collection Genre" - } - } -} diff --git a/fixtures/connector/chinook/schema/Invoice.json b/fixtures/connector/chinook/schema/Invoice.json deleted file mode 100644 index aa9a3c91..00000000 --- a/fixtures/connector/chinook/schema/Invoice.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "Invoice", - "collections": { - "Invoice": { - "type": "Invoice" - } - }, - "objectTypes": { - "Invoice": { - "fields": { - "BillingAddress": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "BillingCity": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "BillingCountry": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "BillingPostalCode": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "BillingState": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "CustomerId": { - "type": { - "scalar": "int" - } - }, - "InvoiceDate": { - "type": { - "scalar": "string" - } - }, - "InvoiceId": { - "type": { - "scalar": "int" - } - }, - "Total": { - "type": { - "scalar": "decimal" - } - }, - "_id": { - "type": { - "scalar": "objectId" - } - } - }, - "description": "Object type for collection Invoice" - } - } -} diff --git a/fixtures/connector/chinook/schema/InvoiceLine.json b/fixtures/connector/chinook/schema/InvoiceLine.json deleted file mode 100644 index 438d023b..00000000 --- a/fixtures/connector/chinook/schema/InvoiceLine.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "InvoiceLine", - "collections": { - "InvoiceLine": { - "type": "InvoiceLine" - } - }, - "objectTypes": { - "InvoiceLine": { - "fields": { - "InvoiceId": { - "type": { - "scalar": "int" - } - }, - "InvoiceLineId": { - "type": { - "scalar": "int" - } - }, - "Quantity": { - "type": { - "scalar": "int" - } - }, - "TrackId": { - "type": { - "scalar": "int" - } - }, - "UnitPrice": { - "type": { - "scalar": "decimal" - } - }, - "_id": { - "type": { - "scalar": "objectId" - } - } - }, - "description": "Object type for collection InvoiceLine" - } - } -} diff --git a/fixtures/connector/chinook/schema/MediaType.json b/fixtures/connector/chinook/schema/MediaType.json deleted file mode 100644 index 79912879..00000000 --- a/fixtures/connector/chinook/schema/MediaType.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "MediaType", - "collections": { - "MediaType": { - "type": "MediaType" - } - }, - "objectTypes": { - "MediaType": { - "fields": { - "MediaTypeId": { - "type": { - "scalar": "int" - } - }, - "Name": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "_id": { - "type": { - "scalar": "objectId" - } - } - }, - "description": "Object type for collection MediaType" - } - } -} diff --git a/fixtures/connector/chinook/schema/Playlist.json b/fixtures/connector/chinook/schema/Playlist.json deleted file mode 100644 index 74dee27f..00000000 --- a/fixtures/connector/chinook/schema/Playlist.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "Playlist", - "collections": { - "Playlist": { - "type": "Playlist" - } - }, - "objectTypes": { - "Playlist": { - "fields": { - "Name": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "PlaylistId": { - "type": { - "scalar": "int" - } - }, - "_id": { - "type": { - "scalar": "objectId" - } - } - }, - "description": "Object type for collection Playlist" - } - } -} diff --git a/fixtures/connector/chinook/schema/PlaylistTrack.json b/fixtures/connector/chinook/schema/PlaylistTrack.json deleted file mode 100644 index e4382592..00000000 --- a/fixtures/connector/chinook/schema/PlaylistTrack.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "PlaylistTrack", - "collections": { - "PlaylistTrack": { - "type": "PlaylistTrack" - } - }, - "objectTypes": { - "PlaylistTrack": { - "fields": { - "PlaylistId": { - "type": { - "scalar": "int" - } - }, - "TrackId": { - "type": { - "scalar": "int" - } - }, - "_id": { - "type": { - "scalar": "objectId" - } - } - }, - "description": "Object type for collection PlaylistTrack" - } - } -} diff --git a/fixtures/connector/chinook/schema/Track.json b/fixtures/connector/chinook/schema/Track.json deleted file mode 100644 index a0d11820..00000000 --- a/fixtures/connector/chinook/schema/Track.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "Track", - "collections": { - "Track": { - "type": "Track" - } - }, - "objectTypes": { - "Track": { - "fields": { - "AlbumId": { - "type": { - "nullable": { - "scalar": "int" - } - } - }, - "Bytes": { - "type": { - "nullable": { - "scalar": "int" - } - } - }, - "Composer": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "GenreId": { - "type": { - "nullable": { - "scalar": "int" - } - } - }, - "MediaTypeId": { - "type": { - "scalar": "int" - } - }, - "Milliseconds": { - "type": { - "scalar": "int" - } - }, - "Name": { - "type": { - "scalar": "string" - } - }, - "TrackId": { - "type": { - "scalar": "int" - } - }, - "UnitPrice": { - "type": { - "scalar": "decimal" - } - }, - "_id": { - "type": { - "scalar": "objectId" - } - } - }, - "description": "Object type for collection Track" - } - } -} diff --git a/fixtures/connector/sample_mflix/schema/comments.json b/fixtures/connector/sample_mflix/schema/comments.json deleted file mode 100644 index bc8d022e..00000000 --- a/fixtures/connector/sample_mflix/schema/comments.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "comments", - "collections": { - "comments": { - "type": "comments" - } - }, - "objectTypes": { - "comments": { - "fields": { - "_id": { - "type": { - "scalar": "objectId" - } - }, - "date": { - "type": { - "scalar": "date" - } - }, - "email": { - "type": { - "scalar": "string" - } - }, - "movie_id": { - "type": { - "scalar": "objectId" - } - }, - "name": { - "type": { - "scalar": "string" - } - }, - "text": { - "type": { - "scalar": "string" - } - } - } - } - } -} \ No newline at end of file diff --git a/fixtures/connector/sample_mflix/schema/movies.json b/fixtures/connector/sample_mflix/schema/movies.json deleted file mode 100644 index bb96aee5..00000000 --- a/fixtures/connector/sample_mflix/schema/movies.json +++ /dev/null @@ -1,296 +0,0 @@ -{ - "name": "movies", - "collections": { - "movies": { - "type": "movies" - } - }, - "objectTypes": { - "movies": { - "fields": { - "_id": { - "type": { - "scalar": "objectId" - } - }, - "awards": { - "type": { - "object": "movies_awards" - } - }, - "cast": { - "type": { - "nullable": { - "arrayOf": { - "scalar": "string" - } - } - } - }, - "countries": { - "type": { - "arrayOf": { - "scalar": "string" - } - } - }, - "directors": { - "type": { - "arrayOf": { - "scalar": "string" - } - } - }, - "fullplot": { - "type": { - "scalar": "string" - } - }, - "genres": { - "type": { - "arrayOf": { - "scalar": "string" - } - } - }, - "imdb": { - "type": { - "object": "movies_imdb" - } - }, - "languages": { - "type": { - "arrayOf": { - "scalar": "string" - } - } - }, - "lastupdated": { - "type": { - "scalar": "string" - } - }, - "metacritic": { - "type": { - "nullable": { - "scalar": "int" - } - } - }, - "num_mflix_comments": { - "type": { - "nullable": { - "scalar": "int" - } - } - }, - "plot": { - "type": { - "scalar": "string" - } - }, - "poster": { - "type": { - "scalar": "string" - } - }, - "rated": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "released": { - "type": { - "scalar": "date" - } - }, - "runtime": { - "type": { - "scalar": "int" - } - }, - "title": { - "type": { - "scalar": "string" - } - }, - "tomatoes": { - "type": { - "object": "movies_tomatoes" - } - }, - "type": { - "type": { - "scalar": "string" - } - }, - "writers": { - "type": { - "arrayOf": { - "scalar": "string" - } - } - }, - "year": { - "type": { - "scalar": "int" - } - } - } - }, - "movies_awards": { - "fields": { - "nominations": { - "type": { - "scalar": "int" - } - }, - "text": { - "type": { - "scalar": "string" - } - }, - "wins": { - "type": { - "scalar": "int" - } - } - } - }, - "movies_imdb": { - "fields": { - "id": { - "type": { - "scalar": "int" - } - }, - "rating": { - "type": { - "scalar": "double" - } - }, - "votes": { - "type": { - "scalar": "int" - } - } - } - }, - "movies_tomatoes": { - "fields": { - "boxOffice": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "consensus": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "critic": { - "type": { - "nullable": { - "object": "movies_tomatoes_critic" - } - } - }, - "dvd": { - "type": { - "nullable": { - "scalar": "date" - } - } - }, - "fresh": { - "type": { - "nullable": { - "scalar": "int" - } - } - }, - "lastUpdated": { - "type": { - "scalar": "date" - } - }, - "production": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "rotten": { - "type": { - "nullable": { - "scalar": "int" - } - } - }, - "viewer": { - "type": { - "object": "movies_tomatoes_viewer" - } - }, - "website": { - "type": { - "nullable": { - "scalar": "string" - } - } - } - } - }, - "movies_tomatoes_critic": { - "fields": { - "meter": { - "type": { - "nullable": { - "scalar": "int" - } - } - }, - "numReviews": { - "type": { - "scalar": "int" - } - }, - "rating": { - "type": { - "nullable": { - "scalar": "double" - } - } - } - } - }, - "movies_tomatoes_viewer": { - "fields": { - "meter": { - "type": { - "scalar": "int" - } - }, - "numReviews": { - "type": { - "scalar": "int" - } - }, - "rating": { - "type": { - "nullable": { - "scalar": "double" - } - } - } - } - } - } -} diff --git a/fixtures/connector/sample_mflix/schema/sessions.json b/fixtures/connector/sample_mflix/schema/sessions.json deleted file mode 100644 index 364b9050..00000000 --- a/fixtures/connector/sample_mflix/schema/sessions.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "sessions", - "collections": { - "sessions": { - "type": "sessions" - } - }, - "objectTypes": { - "sessions": { - "fields": { - "_id": { - "type": { - "scalar": "objectId" - } - }, - "jwt": { - "type": { - "scalar": "string" - } - }, - "user_id": { - "type": { - "scalar": "string" - } - } - } - } - } -} \ No newline at end of file diff --git a/fixtures/connector/sample_mflix/schema/theaters.json b/fixtures/connector/sample_mflix/schema/theaters.json deleted file mode 100644 index df44678b..00000000 --- a/fixtures/connector/sample_mflix/schema/theaters.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "name": "theaters", - "collections": { - "theaters": { - "type": "theaters" - } - }, - "objectTypes": { - "theaters": { - "fields": { - "_id": { - "type": { - "scalar": "objectId" - } - }, - "location": { - "type": { - "object": "theaters_location" - } - }, - "theaterId": { - "type": { - "scalar": "int" - } - } - } - }, - "theaters_location": { - "fields": { - "address": { - "type": { - "object": "theaters_location_address" - } - }, - "geo": { - "type": { - "object": "theaters_location_geo" - } - } - } - }, - "theaters_location_address": { - "fields": { - "city": { - "type": { - "scalar": "string" - } - }, - "state": { - "type": { - "scalar": "string" - } - }, - "street1": { - "type": { - "scalar": "string" - } - }, - "street2": { - "type": { - "nullable": { - "scalar": "string" - } - } - }, - "zipcode": { - "type": { - "scalar": "string" - } - } - } - }, - "theaters_location_geo": { - "fields": { - "coordinates": { - "type": { - "arrayOf": { - "scalar": "double" - } - } - }, - "type": { - "type": { - "scalar": "string" - } - } - } - } - } -} \ No newline at end of file diff --git a/fixtures/connector/sample_mflix/schema/users.json b/fixtures/connector/sample_mflix/schema/users.json deleted file mode 100644 index 71e27cec..00000000 --- a/fixtures/connector/sample_mflix/schema/users.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "users", - "collections": { - "users": { - "type": "users" - } - }, - "objectTypes": { - "users": { - "fields": { - "_id": { - "type": { - "scalar": "objectId" - } - }, - "email": { - "type": { - "scalar": "string" - } - }, - "name": { - "type": { - "scalar": "string" - } - }, - "password": { - "type": { - "scalar": "string" - } - } - } - } - } -} \ No newline at end of file diff --git a/fixtures/ddn/chinook/commands/.gitkeep b/fixtures/ddn/chinook/commands/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/ddn/chinook/commands/InsertArtist.hml b/fixtures/ddn/chinook/commands/InsertArtist.hml deleted file mode 100644 index 9dd323da..00000000 --- a/fixtures/ddn/chinook/commands/InsertArtist.hml +++ /dev/null @@ -1,61 +0,0 @@ -kind: Command -version: v1 -definition: - name: insertArtist - description: Example of a database update using a native mutation - outputType: InsertArtist - arguments: - - name: id - type: Int! - - name: name - type: String! - source: - dataConnectorName: chinook - dataConnectorCommand: - procedure: insertArtist - argumentMapping: - id: id - name: name - graphql: - rootFieldName: insertArtist - rootFieldKind: Mutation - ---- -kind: CommandPermissions -version: v1 -definition: - commandName: insertArtist - permissions: - - role: admin - allowExecution: true - ---- -kind: ObjectType -version: v1 -definition: - name: InsertArtist - graphql: - typeName: InsertArtist - 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/ddn/chinook/dataconnectors/.gitkeep b/fixtures/ddn/chinook/dataconnectors/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/ddn/chinook/dataconnectors/chinook-types.hml b/fixtures/ddn/chinook/dataconnectors/chinook-types.hml deleted file mode 100644 index 8be96015..00000000 --- a/fixtures/ddn/chinook/dataconnectors/chinook-types.hml +++ /dev/null @@ -1,65 +0,0 @@ ---- -kind: ScalarType -version: v1 -definition: - name: Chinook_ObjectId - graphql: - typeName: Chinook_ObjectId - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: chinook - dataConnectorScalarType: ObjectId - representation: Chinook_ObjectId - graphql: - comparisonExpressionTypeName: Chinook_ObjectIdComparisonExp - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: chinook - dataConnectorScalarType: Int - representation: Int - graphql: - comparisonExpressionTypeName: IntComparisonExp - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: chinook - dataConnectorScalarType: String - representation: String - graphql: - comparisonExpressionTypeName: StringComparisonExp - ---- -kind: ScalarType -version: v1 -definition: - name: Chinook_ExtendedJson - graphql: - typeName: Chinook_ExtendedJson - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: chinook - dataConnectorScalarType: ExtendedJSON - representation: Chinook_ExtendedJson - graphql: - comparisonExpressionTypeName: Chinook_ExtendedJsonComparisonExp - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: chinook - dataConnectorScalarType: Float - representation: Float - graphql: - comparisonExpressionTypeName: FloatComparisonExp diff --git a/fixtures/ddn/chinook/dataconnectors/chinook.hml b/fixtures/ddn/chinook/dataconnectors/chinook.hml deleted file mode 100644 index f708402f..00000000 --- a/fixtures/ddn/chinook/dataconnectors/chinook.hml +++ /dev/null @@ -1,939 +0,0 @@ -kind: DataConnectorLink -version: v1 -definition: - name: chinook - url: - singleUrl: - value: http://localhost:7130 - schema: - version: v0.1 - schema: - scalar_types: - BinData: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: - _eq: - type: equal - _neq: - type: custom - argument_type: - type: named - name: BinData - Boolean: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: - _eq: - type: equal - _neq: - type: custom - argument_type: - type: named - name: Boolean - Date: - aggregate_functions: - count: - result_type: - type: named - name: Int - max: - result_type: - type: named - name: Date - min: - result_type: - type: named - name: Date - comparison_operators: - _eq: - type: equal - _gt: - type: custom - argument_type: - type: named - name: Date - _gte: - type: custom - argument_type: - type: named - name: Date - _lt: - type: custom - argument_type: - type: named - name: Date - _lte: - type: custom - argument_type: - type: named - name: Date - _neq: - type: custom - argument_type: - type: named - name: Date - DbPointer: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: - _eq: - type: equal - _neq: - type: custom - argument_type: - type: named - name: DbPointer - Decimal: - aggregate_functions: - avg: - result_type: - type: named - name: Decimal - count: - result_type: - type: named - name: Int - max: - result_type: - type: named - name: Decimal - min: - result_type: - type: named - name: Decimal - sum: - result_type: - type: named - name: Decimal - comparison_operators: - _eq: - type: equal - _gt: - type: custom - argument_type: - type: named - name: Decimal - _gte: - type: custom - argument_type: - type: named - name: Decimal - _lt: - type: custom - argument_type: - type: named - name: Decimal - _lte: - type: custom - argument_type: - type: named - name: Decimal - _neq: - type: custom - argument_type: - type: named - name: Decimal - ExtendedJSON: - aggregate_functions: {} - comparison_operators: {} - Float: - aggregate_functions: - avg: - result_type: - type: named - name: Float - count: - result_type: - type: named - name: Int - max: - result_type: - type: named - name: Float - min: - result_type: - type: named - name: Float - sum: - result_type: - type: named - name: Float - comparison_operators: - _eq: - type: equal - _gt: - type: custom - argument_type: - type: named - name: Float - _gte: - type: custom - argument_type: - type: named - name: Float - _lt: - type: custom - argument_type: - type: named - name: Float - _lte: - type: custom - argument_type: - type: named - name: Float - _neq: - type: custom - argument_type: - type: named - name: Float - Int: - aggregate_functions: - avg: - result_type: - type: named - name: Int - count: - result_type: - type: named - name: Int - max: - result_type: - type: named - name: Int - min: - result_type: - type: named - name: Int - sum: - result_type: - type: named - name: Int - comparison_operators: - _eq: - type: equal - _gt: - type: custom - argument_type: - type: named - name: Int - _gte: - type: custom - argument_type: - type: named - name: Int - _lt: - type: custom - argument_type: - type: named - name: Int - _lte: - type: custom - argument_type: - type: named - name: Int - _neq: - type: custom - argument_type: - type: named - name: Int - Javascript: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: {} - JavascriptWithScope: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: {} - Long: - aggregate_functions: - avg: - result_type: - type: named - name: Long - count: - result_type: - type: named - name: Int - max: - result_type: - type: named - name: Long - min: - result_type: - type: named - name: Long - sum: - result_type: - type: named - name: Long - comparison_operators: - _eq: - type: equal - _gt: - type: custom - argument_type: - type: named - name: Long - _gte: - type: custom - argument_type: - type: named - name: Long - _lt: - type: custom - argument_type: - type: named - name: Long - _lte: - type: custom - argument_type: - type: named - name: Long - _neq: - type: custom - argument_type: - type: named - name: Long - MaxKey: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: - _eq: - type: equal - _neq: - type: custom - argument_type: - type: named - name: MaxKey - MinKey: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: - _eq: - type: equal - _neq: - type: custom - argument_type: - type: named - name: MinKey - "Null": - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: - _eq: - type: equal - _neq: - type: custom - argument_type: - type: named - name: "Null" - ObjectId: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: - _eq: - type: equal - _neq: - type: custom - argument_type: - type: named - name: ObjectId - Regex: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: {} - String: - aggregate_functions: - count: - result_type: - type: named - name: Int - max: - result_type: - type: named - name: String - min: - result_type: - type: named - name: String - comparison_operators: - _eq: - type: equal - _gt: - type: custom - argument_type: - type: named - name: String - _gte: - type: custom - argument_type: - type: named - name: String - _iregex: - type: custom - argument_type: - type: named - name: String - _lt: - type: custom - argument_type: - type: named - name: String - _lte: - type: custom - argument_type: - type: named - name: String - _neq: - type: custom - argument_type: - type: named - name: String - _regex: - type: custom - argument_type: - type: named - name: String - Symbol: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: - _eq: - type: equal - _neq: - type: custom - argument_type: - type: named - name: Symbol - Timestamp: - aggregate_functions: - count: - result_type: - type: named - name: Int - max: - result_type: - type: named - name: Timestamp - min: - result_type: - type: named - name: Timestamp - comparison_operators: - _eq: - type: equal - _gt: - type: custom - argument_type: - type: named - name: Timestamp - _gte: - type: custom - argument_type: - type: named - name: Timestamp - _lt: - type: custom - argument_type: - type: named - name: Timestamp - _lte: - type: custom - argument_type: - type: named - name: Timestamp - _neq: - type: custom - argument_type: - type: named - name: Timestamp - Undefined: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: - _eq: - type: equal - _neq: - type: custom - argument_type: - type: named - name: Undefined - object_types: - Album: - fields: - _id: - type: - type: named - name: ObjectId - AlbumId: - type: - type: named - name: Int - ArtistId: - type: - type: named - name: Int - Title: - type: - type: named - name: String - Artist: - fields: - _id: - type: - type: named - name: ObjectId - ArtistId: - type: - type: named - name: Int - Name: - type: - type: named - name: String - Customer: - fields: - _id: - type: - type: named - name: ObjectId - Address: - type: - type: named - name: String - City: - type: - type: named - name: String - Company: - type: - type: named - name: String - Country: - type: - type: named - name: String - CustomerId: - type: - type: named - name: Int - Email: - type: - type: named - name: String - Fax: - type: - type: named - name: String - FirstName: - type: - type: named - name: String - LastName: - type: - type: named - name: String - Phone: - type: - type: named - name: String - PostalCode: - type: - type: nullable - underlying_type: - type: named - name: ExtendedJSON - State: - type: - type: named - name: String - SupportRepId: - type: - type: named - name: Int - Employee: - fields: - _id: - type: - type: named - name: ObjectId - Address: - type: - type: named - name: String - BirthDate: - type: - type: named - name: String - City: - type: - type: named - name: String - Country: - type: - type: named - name: String - Email: - type: - type: named - name: String - EmployeeId: - type: - type: named - name: Int - Fax: - type: - type: named - name: String - FirstName: - type: - type: named - name: String - HireDate: - type: - type: named - name: String - LastName: - type: - type: named - name: String - Phone: - type: - type: named - name: String - PostalCode: - type: - type: named - name: String - ReportsTo: - type: - type: nullable - underlying_type: - type: named - name: Int - State: - type: - type: named - name: String - Title: - type: - type: named - name: String - Genre: - fields: - _id: - type: - type: named - name: ObjectId - GenreId: - type: - type: named - name: Int - Name: - type: - type: named - name: String - Invoice: - fields: - _id: - type: - type: named - name: ObjectId - BillingAddress: - type: - type: named - name: String - BillingCity: - type: - type: named - name: String - BillingCountry: - type: - type: named - name: String - BillingPostalCode: - type: - type: nullable - underlying_type: - type: named - name: ExtendedJSON - BillingState: - type: - type: named - name: String - CustomerId: - type: - type: named - name: Int - InvoiceDate: - type: - type: named - name: String - InvoiceId: - type: - type: named - name: Int - Total: - type: - type: named - name: Float - InvoiceLine: - fields: - _id: - type: - type: named - name: ObjectId - InvoiceId: - type: - type: named - name: Int - InvoiceLineId: - type: - type: named - name: Int - Quantity: - type: - type: named - name: Int - TrackId: - type: - type: named - name: Int - UnitPrice: - type: - type: named - name: Float - MediaType: - fields: - _id: - type: - type: named - name: ObjectId - MediaTypeId: - type: - type: named - name: Int - Name: - type: - type: named - name: String - Playlist: - fields: - _id: - type: - type: named - name: ObjectId - Name: - type: - type: named - name: String - PlaylistId: - type: - type: named - name: Int - PlaylistTrack: - fields: - _id: - type: - type: named - name: ObjectId - PlaylistId: - type: - type: named - name: Int - TrackId: - type: - type: named - name: Int - Track: - fields: - _id: - type: - type: named - name: ObjectId - AlbumId: - type: - type: named - name: Int - Bytes: - type: - type: named - name: Int - Composer: - type: - type: named - name: String - GenreId: - type: - type: named - name: Int - MediaTypeId: - type: - type: named - name: Int - Milliseconds: - type: - type: named - name: Int - Name: - type: - type: named - name: String - TrackId: - type: - type: named - name: Int - UnitPrice: - type: - type: named - name: Float - InsertArtist: - fields: - ok: - type: { type: named, name: Double } - n: - type: { type: named, name: Int } - collections: - - name: Album - arguments: {} - type: Album - uniqueness_constraints: - Album_id: - unique_columns: - - _id - foreign_keys: {} - - name: Artist - arguments: {} - type: Artist - uniqueness_constraints: - Artist_id: - unique_columns: - - _id - foreign_keys: {} - - name: Customer - arguments: {} - type: Customer - uniqueness_constraints: - Customer_id: - unique_columns: - - _id - foreign_keys: {} - - name: Employee - arguments: {} - type: Employee - uniqueness_constraints: - Employee_id: - unique_columns: - - _id - foreign_keys: {} - - name: Genre - arguments: {} - type: Genre - uniqueness_constraints: - Genre_id: - unique_columns: - - _id - foreign_keys: {} - - name: Invoice - arguments: {} - type: Invoice - uniqueness_constraints: - Invoice_id: - unique_columns: - - _id - foreign_keys: {} - - name: InvoiceLine - arguments: {} - type: InvoiceLine - uniqueness_constraints: - InvoiceLine_id: - unique_columns: - - _id - foreign_keys: {} - - name: MediaType - arguments: {} - type: MediaType - uniqueness_constraints: - MediaType_id: - unique_columns: - - _id - foreign_keys: {} - - name: Playlist - arguments: {} - type: Playlist - uniqueness_constraints: - Playlist_id: - unique_columns: - - _id - foreign_keys: {} - - name: PlaylistTrack - arguments: {} - type: PlaylistTrack - uniqueness_constraints: - PlaylistTrack_id: - unique_columns: - - _id - foreign_keys: {} - - name: Track - arguments: {} - type: Track - uniqueness_constraints: - Track_id: - unique_columns: - - _id - foreign_keys: {} - functions: [] - procedures: - - name: insertArtist - description: Example of a database update using a native procedure - result_type: { type: named, name: InsertArtist } - arguments: - id: { type: { type: named, name: Int } } - name: { type: { type: named, name: String } } - capabilities: - version: 0.1.1 - capabilities: - query: - aggregates: {} - variables: {} - explain: {} - mutation: {} - relationships: {} - diff --git a/fixtures/ddn/chinook/models/Album.hml b/fixtures/ddn/chinook/models/Album.hml deleted file mode 100644 index a17cf54c..00000000 --- a/fixtures/ddn/chinook/models/Album.hml +++ /dev/null @@ -1,114 +0,0 @@ ---- -kind: ObjectType -version: v1 -definition: - name: Album - fields: - - name: id - type: Chinook_ObjectId! - - name: albumId - type: Int! - - name: artistId - type: Int! - - name: title - type: String! - graphql: - typeName: Album - inputTypeName: AlbumInput - dataConnectorTypeMapping: - - dataConnectorName: chinook - dataConnectorObjectType: Album - fieldMapping: - id: - column: - name: _id - albumId: - column: - name: AlbumId - artistId: - column: - name: ArtistId - title: - column: - name: Title - ---- -kind: TypePermissions -version: v1 -definition: - typeName: Album - permissions: - - role: admin - output: - allowedFields: - - id - - albumId - - artistId - - title - ---- -kind: ObjectBooleanExpressionType -version: v1 -definition: - name: AlbumBoolExp - objectType: Album - dataConnectorName: chinook - dataConnectorObjectType: Album - comparableFields: - - fieldName: id - operators: - enableAll: true - - fieldName: albumId - operators: - enableAll: true - - fieldName: artistId - operators: - enableAll: true - - fieldName: title - operators: - enableAll: true - graphql: - typeName: AlbumBoolExp - ---- -kind: Model -version: v1 -definition: - name: Album - objectType: Album - source: - dataConnectorName: chinook - collection: Album - filterExpressionType: AlbumBoolExp - orderableFields: - - fieldName: id - orderByDirections: - enableAll: true - - fieldName: albumId - orderByDirections: - enableAll: true - - fieldName: artistId - orderByDirections: - enableAll: true - - fieldName: title - orderByDirections: - enableAll: true - graphql: - selectMany: - queryRootField: album - selectUniques: - - queryRootField: albumById - uniqueIdentifier: - - id - orderByExpressionType: AlbumOrderBy - ---- -kind: ModelPermissions -version: v1 -definition: - modelName: Album - permissions: - - role: admin - select: - filter: null - diff --git a/fixtures/ddn/chinook/models/Artist.hml b/fixtures/ddn/chinook/models/Artist.hml deleted file mode 100644 index b88dccf6..00000000 --- a/fixtures/ddn/chinook/models/Artist.hml +++ /dev/null @@ -1,102 +0,0 @@ ---- -kind: ObjectType -version: v1 -definition: - name: Artist - fields: - - name: id - type: Chinook_ObjectId! - - name: artistId - type: Int! - - name: name - type: String! - graphql: - typeName: Artist - inputTypeName: ArtistInput - dataConnectorTypeMapping: - - dataConnectorName: chinook - dataConnectorObjectType: Artist - fieldMapping: - id: - column: - name: _id - artistId: - column: - name: ArtistId - name: - column: - name: Name - ---- -kind: TypePermissions -version: v1 -definition: - typeName: Artist - permissions: - - role: admin - output: - allowedFields: - - id - - artistId - - name - ---- -kind: ObjectBooleanExpressionType -version: v1 -definition: - name: ArtistBoolExp - objectType: Artist - dataConnectorName: chinook - dataConnectorObjectType: Artist - comparableFields: - - fieldName: id - operators: - enableAll: true - - fieldName: artistId - operators: - enableAll: true - - fieldName: name - operators: - enableAll: true - graphql: - typeName: ArtistBoolExp - ---- -kind: Model -version: v1 -definition: - name: Artist - objectType: Artist - source: - dataConnectorName: chinook - collection: Artist - filterExpressionType: ArtistBoolExp - orderableFields: - - fieldName: id - orderByDirections: - enableAll: true - - fieldName: artistId - orderByDirections: - enableAll: true - - fieldName: name - orderByDirections: - enableAll: true - graphql: - selectMany: - queryRootField: artist - selectUniques: - - queryRootField: artistById - uniqueIdentifier: - - id - orderByExpressionType: ArtistOrderBy - ---- -kind: ModelPermissions -version: v1 -definition: - modelName: Artist - permissions: - - role: admin - select: - filter: null - diff --git a/fixtures/ddn/chinook/models/Customer.hml b/fixtures/ddn/chinook/models/Customer.hml deleted file mode 100644 index a579f1ca..00000000 --- a/fixtures/ddn/chinook/models/Customer.hml +++ /dev/null @@ -1,234 +0,0 @@ ---- -kind: ObjectType -version: v1 -definition: - name: Customer - fields: - - name: id - type: Chinook_ObjectId! - - name: address - type: String! - - name: city - type: String! - - name: company - type: String! - - name: country - type: String! - - name: customerId - type: Int! - - name: email - type: String! - - name: fax - type: String! - - name: firstName - type: String! - - name: lastName - type: String! - - name: phone - type: String! - - name: postalCode - type: Chinook_ExtendedJson - - name: state - type: String! - - name: supportRepId - type: Int! - graphql: - typeName: Customer - inputTypeName: CustomerInput - dataConnectorTypeMapping: - - dataConnectorName: chinook - dataConnectorObjectType: Customer - fieldMapping: - id: - column: - name: _id - address: - column: - name: Address - city: - column: - name: City - company: - column: - name: Company - country: - column: - name: Country - customerId: - column: - name: CustomerId - email: - column: - name: Email - fax: - column: - name: Fax - firstName: - column: - name: FirstName - lastName: - column: - name: LastName - phone: - column: - name: Phone - postalCode: - column: - name: PostalCode - state: - column: - name: State - supportRepId: - column: - name: SupportRepId - ---- -kind: TypePermissions -version: v1 -definition: - typeName: Customer - permissions: - - role: admin - output: - allowedFields: - - id - - address - - city - - company - - country - - customerId - - email - - fax - - firstName - - lastName - - phone - - postalCode - - state - - supportRepId - ---- -kind: ObjectBooleanExpressionType -version: v1 -definition: - name: CustomerBoolExp - objectType: Customer - dataConnectorName: chinook - dataConnectorObjectType: Customer - comparableFields: - - fieldName: id - operators: - enableAll: true - - fieldName: address - operators: - enableAll: true - - fieldName: city - operators: - enableAll: true - - fieldName: company - operators: - enableAll: true - - fieldName: country - operators: - enableAll: true - - fieldName: customerId - operators: - enableAll: true - - fieldName: email - operators: - enableAll: true - - fieldName: fax - operators: - enableAll: true - - fieldName: firstName - operators: - enableAll: true - - fieldName: lastName - operators: - enableAll: true - - fieldName: phone - operators: - enableAll: true - - fieldName: postalCode - operators: - enableAll: true - - fieldName: state - operators: - enableAll: true - - fieldName: supportRepId - operators: - enableAll: true - graphql: - typeName: CustomerBoolExp - ---- -kind: Model -version: v1 -definition: - name: Customer - objectType: Customer - source: - dataConnectorName: chinook - collection: Customer - filterExpressionType: CustomerBoolExp - orderableFields: - - fieldName: id - orderByDirections: - enableAll: true - - fieldName: address - orderByDirections: - enableAll: true - - fieldName: city - orderByDirections: - enableAll: true - - fieldName: company - orderByDirections: - enableAll: true - - fieldName: country - orderByDirections: - enableAll: true - - fieldName: customerId - orderByDirections: - enableAll: true - - fieldName: email - orderByDirections: - enableAll: true - - fieldName: fax - orderByDirections: - enableAll: true - - fieldName: firstName - orderByDirections: - enableAll: true - - fieldName: lastName - orderByDirections: - enableAll: true - - fieldName: phone - orderByDirections: - enableAll: true - - fieldName: postalCode - orderByDirections: - enableAll: true - - fieldName: state - orderByDirections: - enableAll: true - - fieldName: supportRepId - orderByDirections: - enableAll: true - graphql: - selectMany: - queryRootField: customer - selectUniques: - - queryRootField: customerById - uniqueIdentifier: - - id - orderByExpressionType: CustomerOrderBy - ---- -kind: ModelPermissions -version: v1 -definition: - modelName: Customer - permissions: - - role: admin - select: - filter: null - diff --git a/fixtures/ddn/chinook/models/Employee.hml b/fixtures/ddn/chinook/models/Employee.hml deleted file mode 100644 index 5615c097..00000000 --- a/fixtures/ddn/chinook/models/Employee.hml +++ /dev/null @@ -1,258 +0,0 @@ ---- -kind: ObjectType -version: v1 -definition: - name: Employee - fields: - - name: id - type: Chinook_ObjectId! - - name: address - type: String! - - name: birthDate - type: String! - - name: city - type: String! - - name: country - type: String! - - name: email - type: String! - - name: employeeId - type: Int! - - name: fax - type: String! - - name: firstName - type: String! - - name: hireDate - type: String! - - name: lastName - type: String! - - name: phone - type: String! - - name: postalCode - type: String! - - name: reportsTo - type: Int - - name: state - type: String! - - name: title - type: String! - graphql: - typeName: Employee - inputTypeName: EmployeeInput - dataConnectorTypeMapping: - - dataConnectorName: chinook - dataConnectorObjectType: Employee - fieldMapping: - id: - column: - name: _id - address: - column: - name: Address - birthDate: - column: - name: BirthDate - city: - column: - name: City - country: - column: - name: Country - email: - column: - name: Email - employeeId: - column: - name: EmployeeId - fax: - column: - name: Fax - firstName: - column: - name: FirstName - hireDate: - column: - name: HireDate - lastName: - column: - name: LastName - phone: - column: - name: Phone - postalCode: - column: - name: PostalCode - reportsTo: - column: - name: ReportsTo - state: - column: - name: State - title: - column: - name: Title - ---- -kind: TypePermissions -version: v1 -definition: - typeName: Employee - permissions: - - role: admin - output: - allowedFields: - - id - - address - - birthDate - - city - - country - - email - - employeeId - - fax - - firstName - - hireDate - - lastName - - phone - - postalCode - - reportsTo - - state - - title - ---- -kind: ObjectBooleanExpressionType -version: v1 -definition: - name: EmployeeBoolExp - objectType: Employee - dataConnectorName: chinook - dataConnectorObjectType: Employee - comparableFields: - - fieldName: id - operators: - enableAll: true - - fieldName: address - operators: - enableAll: true - - fieldName: birthDate - operators: - enableAll: true - - fieldName: city - operators: - enableAll: true - - fieldName: country - operators: - enableAll: true - - fieldName: email - operators: - enableAll: true - - fieldName: employeeId - operators: - enableAll: true - - fieldName: fax - operators: - enableAll: true - - fieldName: firstName - operators: - enableAll: true - - fieldName: hireDate - operators: - enableAll: true - - fieldName: lastName - operators: - enableAll: true - - fieldName: phone - operators: - enableAll: true - - fieldName: postalCode - operators: - enableAll: true - - fieldName: reportsTo - operators: - enableAll: true - - fieldName: state - operators: - enableAll: true - - fieldName: title - operators: - enableAll: true - graphql: - typeName: EmployeeBoolExp - ---- -kind: Model -version: v1 -definition: - name: Employee - objectType: Employee - source: - dataConnectorName: chinook - collection: Employee - filterExpressionType: EmployeeBoolExp - orderableFields: - - fieldName: id - orderByDirections: - enableAll: true - - fieldName: address - orderByDirections: - enableAll: true - - fieldName: birthDate - orderByDirections: - enableAll: true - - fieldName: city - orderByDirections: - enableAll: true - - fieldName: country - orderByDirections: - enableAll: true - - fieldName: email - orderByDirections: - enableAll: true - - fieldName: employeeId - orderByDirections: - enableAll: true - - fieldName: fax - orderByDirections: - enableAll: true - - fieldName: firstName - orderByDirections: - enableAll: true - - fieldName: hireDate - orderByDirections: - enableAll: true - - fieldName: lastName - orderByDirections: - enableAll: true - - fieldName: phone - orderByDirections: - enableAll: true - - fieldName: postalCode - orderByDirections: - enableAll: true - - fieldName: reportsTo - orderByDirections: - enableAll: true - - fieldName: state - orderByDirections: - enableAll: true - - fieldName: title - orderByDirections: - enableAll: true - graphql: - selectMany: - queryRootField: employee - selectUniques: - - queryRootField: employeeById - uniqueIdentifier: - - id - orderByExpressionType: EmployeeOrderBy - ---- -kind: ModelPermissions -version: v1 -definition: - modelName: Employee - permissions: - - role: admin - select: - filter: null - diff --git a/fixtures/ddn/chinook/models/Genre.hml b/fixtures/ddn/chinook/models/Genre.hml deleted file mode 100644 index 916ab2e1..00000000 --- a/fixtures/ddn/chinook/models/Genre.hml +++ /dev/null @@ -1,102 +0,0 @@ ---- -kind: ObjectType -version: v1 -definition: - name: Genre - fields: - - name: id - type: Chinook_ObjectId! - - name: genreId - type: Int! - - name: name - type: String! - graphql: - typeName: Genre - inputTypeName: GenreInput - dataConnectorTypeMapping: - - dataConnectorName: chinook - dataConnectorObjectType: Genre - fieldMapping: - id: - column: - name: _id - genreId: - column: - name: GenreId - name: - column: - name: Name - ---- -kind: TypePermissions -version: v1 -definition: - typeName: Genre - permissions: - - role: admin - output: - allowedFields: - - id - - genreId - - name - ---- -kind: ObjectBooleanExpressionType -version: v1 -definition: - name: GenreBoolExp - objectType: Genre - dataConnectorName: chinook - dataConnectorObjectType: Genre - comparableFields: - - fieldName: id - operators: - enableAll: true - - fieldName: genreId - operators: - enableAll: true - - fieldName: name - operators: - enableAll: true - graphql: - typeName: GenreBoolExp - ---- -kind: Model -version: v1 -definition: - name: Genre - objectType: Genre - source: - dataConnectorName: chinook - collection: Genre - filterExpressionType: GenreBoolExp - orderableFields: - - fieldName: id - orderByDirections: - enableAll: true - - fieldName: genreId - orderByDirections: - enableAll: true - - fieldName: name - orderByDirections: - enableAll: true - graphql: - selectMany: - queryRootField: genre - selectUniques: - - queryRootField: genreById - uniqueIdentifier: - - id - orderByExpressionType: GenreOrderBy - ---- -kind: ModelPermissions -version: v1 -definition: - modelName: Genre - permissions: - - role: admin - select: - filter: null - diff --git a/fixtures/ddn/chinook/models/Invoice.hml b/fixtures/ddn/chinook/models/Invoice.hml deleted file mode 100644 index 50b6558d..00000000 --- a/fixtures/ddn/chinook/models/Invoice.hml +++ /dev/null @@ -1,186 +0,0 @@ ---- -kind: ObjectType -version: v1 -definition: - name: Invoice - fields: - - name: id - type: Chinook_ObjectId! - - name: billingAddress - type: String! - - name: billingCity - type: String! - - name: billingCountry - type: String! - - name: billingPostalCode - type: Chinook_ExtendedJson - - name: billingState - type: String! - - name: customerId - type: Int! - - name: invoiceDate - type: String! - - name: invoiceId - type: Int! - - name: total - type: Float! - graphql: - typeName: Invoice - inputTypeName: InvoiceInput - dataConnectorTypeMapping: - - dataConnectorName: chinook - dataConnectorObjectType: Invoice - fieldMapping: - id: - column: - name: _id - billingAddress: - column: - name: BillingAddress - billingCity: - column: - name: BillingCity - billingCountry: - column: - name: BillingCountry - billingPostalCode: - column: - name: BillingPostalCode - billingState: - column: - name: BillingState - customerId: - column: - name: CustomerId - invoiceDate: - column: - name: InvoiceDate - invoiceId: - column: - name: InvoiceId - total: - column: - name: Total - ---- -kind: TypePermissions -version: v1 -definition: - typeName: Invoice - permissions: - - role: admin - output: - allowedFields: - - id - - billingAddress - - billingCity - - billingCountry - - billingPostalCode - - billingState - - customerId - - invoiceDate - - invoiceId - - total - ---- -kind: ObjectBooleanExpressionType -version: v1 -definition: - name: InvoiceBoolExp - objectType: Invoice - dataConnectorName: chinook - dataConnectorObjectType: Invoice - comparableFields: - - fieldName: id - operators: - enableAll: true - - fieldName: billingAddress - operators: - enableAll: true - - fieldName: billingCity - operators: - enableAll: true - - fieldName: billingCountry - operators: - enableAll: true - - fieldName: billingPostalCode - operators: - enableAll: true - - fieldName: billingState - operators: - enableAll: true - - fieldName: customerId - operators: - enableAll: true - - fieldName: invoiceDate - operators: - enableAll: true - - fieldName: invoiceId - operators: - enableAll: true - - fieldName: total - operators: - enableAll: true - graphql: - typeName: InvoiceBoolExp - ---- -kind: Model -version: v1 -definition: - name: Invoice - objectType: Invoice - source: - dataConnectorName: chinook - collection: Invoice - filterExpressionType: InvoiceBoolExp - orderableFields: - - fieldName: id - orderByDirections: - enableAll: true - - fieldName: billingAddress - orderByDirections: - enableAll: true - - fieldName: billingCity - orderByDirections: - enableAll: true - - fieldName: billingCountry - orderByDirections: - enableAll: true - - fieldName: billingPostalCode - orderByDirections: - enableAll: true - - fieldName: billingState - orderByDirections: - enableAll: true - - fieldName: customerId - orderByDirections: - enableAll: true - - fieldName: invoiceDate - orderByDirections: - enableAll: true - - fieldName: invoiceId - orderByDirections: - enableAll: true - - fieldName: total - orderByDirections: - enableAll: true - graphql: - selectMany: - queryRootField: invoice - selectUniques: - - queryRootField: invoiceById - uniqueIdentifier: - - id - orderByExpressionType: InvoiceOrderBy - ---- -kind: ModelPermissions -version: v1 -definition: - modelName: Invoice - permissions: - - role: admin - select: - filter: null - diff --git a/fixtures/ddn/chinook/models/InvoiceLine.hml b/fixtures/ddn/chinook/models/InvoiceLine.hml deleted file mode 100644 index 39513adc..00000000 --- a/fixtures/ddn/chinook/models/InvoiceLine.hml +++ /dev/null @@ -1,138 +0,0 @@ ---- -kind: ObjectType -version: v1 -definition: - name: InvoiceLine - fields: - - name: id - type: Chinook_ObjectId! - - name: invoiceId - type: Int! - - name: invoiceLineId - type: Int! - - name: quantity - type: Int! - - name: trackId - type: Int! - - name: unitPrice - type: Float! - graphql: - typeName: InvoiceLine - inputTypeName: InvoiceLineInput - dataConnectorTypeMapping: - - dataConnectorName: chinook - dataConnectorObjectType: InvoiceLine - fieldMapping: - id: - column: - name: _id - invoiceId: - column: - name: InvoiceId - invoiceLineId: - column: - name: InvoiceLineId - quantity: - column: - name: Quantity - trackId: - column: - name: TrackId - unitPrice: - column: - name: UnitPrice - ---- -kind: TypePermissions -version: v1 -definition: - typeName: InvoiceLine - permissions: - - role: admin - output: - allowedFields: - - id - - invoiceId - - invoiceLineId - - quantity - - trackId - - unitPrice - ---- -kind: ObjectBooleanExpressionType -version: v1 -definition: - name: InvoiceLineBoolExp - objectType: InvoiceLine - dataConnectorName: chinook - dataConnectorObjectType: InvoiceLine - comparableFields: - - fieldName: id - operators: - enableAll: true - - fieldName: invoiceId - operators: - enableAll: true - - fieldName: invoiceLineId - operators: - enableAll: true - - fieldName: quantity - operators: - enableAll: true - - fieldName: trackId - operators: - enableAll: true - - fieldName: unitPrice - operators: - enableAll: true - graphql: - typeName: InvoiceLineBoolExp - ---- -kind: Model -version: v1 -definition: - name: InvoiceLine - objectType: InvoiceLine - source: - dataConnectorName: chinook - collection: InvoiceLine - filterExpressionType: InvoiceLineBoolExp - orderableFields: - - fieldName: id - orderByDirections: - enableAll: true - - fieldName: invoiceId - orderByDirections: - enableAll: true - - fieldName: invoiceLineId - orderByDirections: - enableAll: true - - fieldName: quantity - orderByDirections: - enableAll: true - - fieldName: trackId - orderByDirections: - enableAll: true - - fieldName: unitPrice - orderByDirections: - enableAll: true - graphql: - selectMany: - queryRootField: invoiceLine - selectUniques: - - queryRootField: invoiceLineById - uniqueIdentifier: - - id - orderByExpressionType: InvoiceLineOrderBy - ---- -kind: ModelPermissions -version: v1 -definition: - modelName: InvoiceLine - permissions: - - role: admin - select: - filter: null - diff --git a/fixtures/ddn/chinook/models/MediaType.hml b/fixtures/ddn/chinook/models/MediaType.hml deleted file mode 100644 index e01e6657..00000000 --- a/fixtures/ddn/chinook/models/MediaType.hml +++ /dev/null @@ -1,102 +0,0 @@ ---- -kind: ObjectType -version: v1 -definition: - name: MediaType - fields: - - name: id - type: Chinook_ObjectId! - - name: mediaTypeId - type: Int! - - name: name - type: String! - graphql: - typeName: MediaType - inputTypeName: MediaTypeInput - dataConnectorTypeMapping: - - dataConnectorName: chinook - dataConnectorObjectType: MediaType - fieldMapping: - id: - column: - name: _id - mediaTypeId: - column: - name: MediaTypeId - name: - column: - name: Name - ---- -kind: TypePermissions -version: v1 -definition: - typeName: MediaType - permissions: - - role: admin - output: - allowedFields: - - id - - mediaTypeId - - name - ---- -kind: ObjectBooleanExpressionType -version: v1 -definition: - name: MediaTypeBoolExp - objectType: MediaType - dataConnectorName: chinook - dataConnectorObjectType: MediaType - comparableFields: - - fieldName: id - operators: - enableAll: true - - fieldName: mediaTypeId - operators: - enableAll: true - - fieldName: name - operators: - enableAll: true - graphql: - typeName: MediaTypeBoolExp - ---- -kind: Model -version: v1 -definition: - name: MediaType - objectType: MediaType - source: - dataConnectorName: chinook - collection: MediaType - filterExpressionType: MediaTypeBoolExp - orderableFields: - - fieldName: id - orderByDirections: - enableAll: true - - fieldName: mediaTypeId - orderByDirections: - enableAll: true - - fieldName: name - orderByDirections: - enableAll: true - graphql: - selectMany: - queryRootField: mediaType - selectUniques: - - queryRootField: mediaTypeById - uniqueIdentifier: - - id - orderByExpressionType: MediaTypeOrderBy - ---- -kind: ModelPermissions -version: v1 -definition: - modelName: MediaType - permissions: - - role: admin - select: - filter: null - diff --git a/fixtures/ddn/chinook/models/Playlist.hml b/fixtures/ddn/chinook/models/Playlist.hml deleted file mode 100644 index 6479bbe4..00000000 --- a/fixtures/ddn/chinook/models/Playlist.hml +++ /dev/null @@ -1,102 +0,0 @@ ---- -kind: ObjectType -version: v1 -definition: - name: Playlist - fields: - - name: id - type: Chinook_ObjectId! - - name: name - type: String! - - name: playlistId - type: Int! - graphql: - typeName: Playlist - inputTypeName: PlaylistInput - dataConnectorTypeMapping: - - dataConnectorName: chinook - dataConnectorObjectType: Playlist - fieldMapping: - id: - column: - name: _id - name: - column: - name: Name - playlistId: - column: - name: PlaylistId - ---- -kind: TypePermissions -version: v1 -definition: - typeName: Playlist - permissions: - - role: admin - output: - allowedFields: - - id - - name - - playlistId - ---- -kind: ObjectBooleanExpressionType -version: v1 -definition: - name: PlaylistBoolExp - objectType: Playlist - dataConnectorName: chinook - dataConnectorObjectType: Playlist - comparableFields: - - fieldName: id - operators: - enableAll: true - - fieldName: name - operators: - enableAll: true - - fieldName: playlistId - operators: - enableAll: true - graphql: - typeName: PlaylistBoolExp - ---- -kind: Model -version: v1 -definition: - name: Playlist - objectType: Playlist - source: - dataConnectorName: chinook - collection: Playlist - filterExpressionType: PlaylistBoolExp - orderableFields: - - fieldName: id - orderByDirections: - enableAll: true - - fieldName: name - orderByDirections: - enableAll: true - - fieldName: playlistId - orderByDirections: - enableAll: true - graphql: - selectMany: - queryRootField: playlist - selectUniques: - - queryRootField: playlistById - uniqueIdentifier: - - id - orderByExpressionType: PlaylistOrderBy - ---- -kind: ModelPermissions -version: v1 -definition: - modelName: Playlist - permissions: - - role: admin - select: - filter: null - diff --git a/fixtures/ddn/chinook/models/PlaylistTrack.hml b/fixtures/ddn/chinook/models/PlaylistTrack.hml deleted file mode 100644 index 1ce858c7..00000000 --- a/fixtures/ddn/chinook/models/PlaylistTrack.hml +++ /dev/null @@ -1,102 +0,0 @@ ---- -kind: ObjectType -version: v1 -definition: - name: PlaylistTrack - fields: - - name: id - type: Chinook_ObjectId! - - name: playlistId - type: Int! - - name: trackId - type: Int! - graphql: - typeName: PlaylistTrack - inputTypeName: PlaylistTrackInput - dataConnectorTypeMapping: - - dataConnectorName: chinook - dataConnectorObjectType: PlaylistTrack - fieldMapping: - id: - column: - name: _id - playlistId: - column: - name: PlaylistId - trackId: - column: - name: TrackId - ---- -kind: TypePermissions -version: v1 -definition: - typeName: PlaylistTrack - permissions: - - role: admin - output: - allowedFields: - - id - - playlistId - - trackId - ---- -kind: ObjectBooleanExpressionType -version: v1 -definition: - name: PlaylistTrackBoolExp - objectType: PlaylistTrack - dataConnectorName: chinook - dataConnectorObjectType: PlaylistTrack - comparableFields: - - fieldName: id - operators: - enableAll: true - - fieldName: playlistId - operators: - enableAll: true - - fieldName: trackId - operators: - enableAll: true - graphql: - typeName: PlaylistTrackBoolExp - ---- -kind: Model -version: v1 -definition: - name: PlaylistTrack - objectType: PlaylistTrack - source: - dataConnectorName: chinook - collection: PlaylistTrack - filterExpressionType: PlaylistTrackBoolExp - orderableFields: - - fieldName: id - orderByDirections: - enableAll: true - - fieldName: playlistId - orderByDirections: - enableAll: true - - fieldName: trackId - orderByDirections: - enableAll: true - graphql: - selectMany: - queryRootField: playlistTrack - selectUniques: - - queryRootField: playlistTrackById - uniqueIdentifier: - - id - orderByExpressionType: PlaylistTrackOrderBy - ---- -kind: ModelPermissions -version: v1 -definition: - modelName: PlaylistTrack - permissions: - - role: admin - select: - filter: null - diff --git a/fixtures/ddn/chinook/models/Track.hml b/fixtures/ddn/chinook/models/Track.hml deleted file mode 100644 index 83c8a7ae..00000000 --- a/fixtures/ddn/chinook/models/Track.hml +++ /dev/null @@ -1,186 +0,0 @@ ---- -kind: ObjectType -version: v1 -definition: - name: Track - fields: - - name: id - type: Chinook_ObjectId! - - name: albumId - type: Int! - - name: bytes - type: Int! - - name: composer - type: String! - - name: genreId - type: Int! - - name: mediaTypeId - type: Int! - - name: milliseconds - type: Int! - - name: name - type: String! - - name: trackId - type: Int! - - name: unitPrice - type: Float! - graphql: - typeName: Track - inputTypeName: TrackInput - dataConnectorTypeMapping: - - dataConnectorName: chinook - dataConnectorObjectType: Track - fieldMapping: - id: - column: - name: _id - albumId: - column: - name: AlbumId - bytes: - column: - name: Bytes - composer: - column: - name: Composer - genreId: - column: - name: GenreId - mediaTypeId: - column: - name: MediaTypeId - milliseconds: - column: - name: Milliseconds - name: - column: - name: Name - trackId: - column: - name: TrackId - unitPrice: - column: - name: UnitPrice - ---- -kind: TypePermissions -version: v1 -definition: - typeName: Track - permissions: - - role: admin - output: - allowedFields: - - id - - albumId - - bytes - - composer - - genreId - - mediaTypeId - - milliseconds - - name - - trackId - - unitPrice - ---- -kind: ObjectBooleanExpressionType -version: v1 -definition: - name: TrackBoolExp - objectType: Track - dataConnectorName: chinook - dataConnectorObjectType: Track - comparableFields: - - fieldName: id - operators: - enableAll: true - - fieldName: albumId - operators: - enableAll: true - - fieldName: bytes - operators: - enableAll: true - - fieldName: composer - operators: - enableAll: true - - fieldName: genreId - operators: - enableAll: true - - fieldName: mediaTypeId - operators: - enableAll: true - - fieldName: milliseconds - operators: - enableAll: true - - fieldName: name - operators: - enableAll: true - - fieldName: trackId - operators: - enableAll: true - - fieldName: unitPrice - operators: - enableAll: true - graphql: - typeName: TrackBoolExp - ---- -kind: Model -version: v1 -definition: - name: Track - objectType: Track - source: - dataConnectorName: chinook - collection: Track - filterExpressionType: TrackBoolExp - orderableFields: - - fieldName: id - orderByDirections: - enableAll: true - - fieldName: albumId - orderByDirections: - enableAll: true - - fieldName: bytes - orderByDirections: - enableAll: true - - fieldName: composer - orderByDirections: - enableAll: true - - fieldName: genreId - orderByDirections: - enableAll: true - - fieldName: mediaTypeId - orderByDirections: - enableAll: true - - fieldName: milliseconds - orderByDirections: - enableAll: true - - fieldName: name - orderByDirections: - enableAll: true - - fieldName: trackId - orderByDirections: - enableAll: true - - fieldName: unitPrice - orderByDirections: - enableAll: true - graphql: - selectMany: - queryRootField: track - selectUniques: - - queryRootField: trackById - uniqueIdentifier: - - id - orderByExpressionType: TrackOrderBy - ---- -kind: ModelPermissions -version: v1 -definition: - modelName: Track - permissions: - - role: admin - select: - filter: null - diff --git a/fixtures/ddn/chinook/relationships/album_tracks.hml b/fixtures/ddn/chinook/relationships/album_tracks.hml deleted file mode 100644 index 6bb61b4b..00000000 --- a/fixtures/ddn/chinook/relationships/album_tracks.hml +++ /dev/null @@ -1,34 +0,0 @@ -kind: Relationship -version: v1 -definition: - name: tracks - source: Album - target: - model: - name: Track - relationshipType: Array - mapping: - - source: - fieldPath: - - fieldName: albumId - target: - modelField: - - fieldName: albumId - ---- -kind: Relationship -version: v1 -definition: - name: album - source: Track - target: - model: - name: Album - relationshipType: Object - mapping: - - source: - fieldPath: - - fieldName: albumId - target: - modelField: - - fieldName: albumId diff --git a/fixtures/ddn/chinook/relationships/artist_albums.hml b/fixtures/ddn/chinook/relationships/artist_albums.hml deleted file mode 100644 index 5d9890b5..00000000 --- a/fixtures/ddn/chinook/relationships/artist_albums.hml +++ /dev/null @@ -1,34 +0,0 @@ -kind: Relationship -version: v1 -definition: - name: artist - source: Album - target: - model: - name: Artist - relationshipType: Object - mapping: - - source: - fieldPath: - - fieldName: artistId - target: - modelField: - - fieldName: artistId - ---- -kind: Relationship -version: v1 -definition: - name: albums - source: Artist - target: - model: - name: Album - relationshipType: Array - mapping: - - source: - fieldPath: - - fieldName: artistId - target: - modelField: - - fieldName: artistId diff --git a/fixtures/ddn/chinook/relationships/customer_invoices.hml b/fixtures/ddn/chinook/relationships/customer_invoices.hml deleted file mode 100644 index 8c744bbe..00000000 --- a/fixtures/ddn/chinook/relationships/customer_invoices.hml +++ /dev/null @@ -1,34 +0,0 @@ -kind: Relationship -version: v1 -definition: - name: invoices - source: Customer - target: - model: - name: Invoice - relationshipType: Array - mapping: - - source: - fieldPath: - - fieldName: customerId - target: - modelField: - - fieldName: customerId - ---- -kind: Relationship -version: v1 -definition: - name: customer - source: Invoice - target: - model: - name: Customer - relationshipType: Object - mapping: - - source: - fieldPath: - - fieldName: customerId - target: - modelField: - - fieldName: customerId diff --git a/fixtures/ddn/chinook/relationships/employee_customers.hml b/fixtures/ddn/chinook/relationships/employee_customers.hml deleted file mode 100644 index d6c31fee..00000000 --- a/fixtures/ddn/chinook/relationships/employee_customers.hml +++ /dev/null @@ -1,34 +0,0 @@ -kind: Relationship -version: v1 -definition: - name: supportRepCustomers - source: Employee - target: - model: - name: Customer - relationshipType: Array - mapping: - - source: - fieldPath: - - fieldName: employeeId - target: - modelField: - - fieldName: supportRepId - ---- -kind: Relationship -version: v1 -definition: - name: supportRep - source: Customer - target: - model: - name: Employee - relationshipType: Object - mapping: - - source: - fieldPath: - - fieldName: supportRepId - target: - modelField: - - fieldName: employeeId diff --git a/fixtures/ddn/chinook/relationships/employee_employees.hml b/fixtures/ddn/chinook/relationships/employee_employees.hml deleted file mode 100644 index 0c44c388..00000000 --- a/fixtures/ddn/chinook/relationships/employee_employees.hml +++ /dev/null @@ -1,34 +0,0 @@ -kind: Relationship -version: v1 -definition: - name: directReports - source: Employee - target: - model: - name: Employee - relationshipType: Array - mapping: - - source: - fieldPath: - - fieldName: employeeId - target: - modelField: - - fieldName: reportsTo - ---- -kind: Relationship -version: v1 -definition: - name: manager - source: Employee - target: - model: - name: Employee - relationshipType: Object - mapping: - - source: - fieldPath: - - fieldName: reportsTo - target: - modelField: - - fieldName: employeeId diff --git a/fixtures/ddn/chinook/relationships/genre_tracks.hml b/fixtures/ddn/chinook/relationships/genre_tracks.hml deleted file mode 100644 index 7b5e49dd..00000000 --- a/fixtures/ddn/chinook/relationships/genre_tracks.hml +++ /dev/null @@ -1,34 +0,0 @@ -kind: Relationship -version: v1 -definition: - name: tracks - source: Genre - target: - model: - name: Track - relationshipType: Array - mapping: - - source: - fieldPath: - - fieldName: genreId - target: - modelField: - - fieldName: genreId - ---- -kind: Relationship -version: v1 -definition: - name: genre - source: Track - target: - model: - name: Genre - relationshipType: Object - mapping: - - source: - fieldPath: - - fieldName: genreId - target: - modelField: - - fieldName: genreId diff --git a/fixtures/ddn/chinook/relationships/invoice_lines.hml b/fixtures/ddn/chinook/relationships/invoice_lines.hml deleted file mode 100644 index 3eaaf79c..00000000 --- a/fixtures/ddn/chinook/relationships/invoice_lines.hml +++ /dev/null @@ -1,34 +0,0 @@ -kind: Relationship -version: v1 -definition: - name: lines - source: Invoice - target: - model: - name: InvoiceLine - relationshipType: Array - mapping: - - source: - fieldPath: - - fieldName: invoiceId - target: - modelField: - - fieldName: invoiceId - ---- -kind: Relationship -version: v1 -definition: - name: invoice - source: InvoiceLine - target: - model: - name: Invoice - relationshipType: Object - mapping: - - source: - fieldPath: - - fieldName: invoiceId - target: - modelField: - - fieldName: invoiceId diff --git a/fixtures/ddn/chinook/relationships/media_type_tracks.hml b/fixtures/ddn/chinook/relationships/media_type_tracks.hml deleted file mode 100644 index 54d2a77d..00000000 --- a/fixtures/ddn/chinook/relationships/media_type_tracks.hml +++ /dev/null @@ -1,34 +0,0 @@ -kind: Relationship -version: v1 -definition: - name: tracks - source: MediaType - target: - model: - name: Track - relationshipType: Array - mapping: - - source: - fieldPath: - - fieldName: mediaTypeId - target: - modelField: - - fieldName: mediaTypeId - ---- -kind: Relationship -version: v1 -definition: - name: mediaType - source: Track - target: - model: - name: MediaType - relationshipType: Object - mapping: - - source: - fieldPath: - - fieldName: mediaTypeId - target: - modelField: - - fieldName: mediaTypeId diff --git a/fixtures/ddn/chinook/relationships/playlist_tracks.hml b/fixtures/ddn/chinook/relationships/playlist_tracks.hml deleted file mode 100644 index cfe6fb1a..00000000 --- a/fixtures/ddn/chinook/relationships/playlist_tracks.hml +++ /dev/null @@ -1,70 +0,0 @@ -kind: Relationship -version: v1 -definition: - name: playlistTracks - source: Playlist - target: - model: - name: PlaylistTrack - relationshipType: Array - mapping: - - source: - fieldPath: - - fieldName: playlistId - target: - modelField: - - fieldName: playlistId - ---- -kind: Relationship -version: v1 -definition: - name: playlist - source: PlaylistTrack - target: - model: - name: Playlist - relationshipType: Object - mapping: - - source: - fieldPath: - - fieldName: playlistId - target: - modelField: - - fieldName: playlistId - ---- -kind: Relationship -version: v1 -definition: - name: track - source: PlaylistTrack - target: - model: - name: Track - relationshipType: Object - mapping: - - source: - fieldPath: - - fieldName: trackId - target: - modelField: - - fieldName: trackId - ---- -kind: Relationship -version: v1 -definition: - name: playlistTracks - source: Track - target: - model: - name: PlaylistTrack - relationshipType: Array - mapping: - - source: - fieldPath: - - fieldName: trackId - target: - modelField: - - fieldName: trackId diff --git a/fixtures/ddn/chinook/relationships/track_invoice_lines.hml b/fixtures/ddn/chinook/relationships/track_invoice_lines.hml deleted file mode 100644 index 0576d71d..00000000 --- a/fixtures/ddn/chinook/relationships/track_invoice_lines.hml +++ /dev/null @@ -1,34 +0,0 @@ -kind: Relationship -version: v1 -definition: - name: invoiceLines - source: Track - target: - model: - name: InvoiceLine - relationshipType: Array - mapping: - - source: - fieldPath: - - fieldName: trackId - target: - modelField: - - fieldName: trackId - ---- -kind: Relationship -version: v1 -definition: - name: track - source: InvoiceLine - target: - model: - name: Track - relationshipType: Object - mapping: - - source: - fieldPath: - - fieldName: trackId - target: - modelField: - - fieldName: trackId diff --git a/fixtures/ddn/remote-relationships_chinook-sample_mflix/album_movie.hml b/fixtures/ddn/remote-relationships_chinook-sample_mflix/album_movie.hml deleted file mode 100644 index 10d0bdf3..00000000 --- a/fixtures/ddn/remote-relationships_chinook-sample_mflix/album_movie.hml +++ /dev/null @@ -1,17 +0,0 @@ -# This is not a meaningful relationship, but it gives us something to test with. -kind: Relationship -version: v1 -definition: - name: movies - source: Album - target: - model: - name: Movies - relationshipType: Array - mapping: - - source: - fieldPath: - - fieldName: albumId - target: - modelField: - - fieldName: runtime diff --git a/fixtures/ddn/sample_mflix/commands/Hello.hml b/fixtures/ddn/sample_mflix/commands/Hello.hml deleted file mode 100644 index 9e58d38c..00000000 --- a/fixtures/ddn/sample_mflix/commands/Hello.hml +++ /dev/null @@ -1,27 +0,0 @@ -kind: Command -version: v1 -definition: - name: hello - description: Basic test of native queries - outputType: String - arguments: - - name: name - type: String! - source: - dataConnectorName: sample_mflix - dataConnectorCommand: - function: hello - argumentMapping: - name: name - graphql: - rootFieldName: hello - rootFieldKind: Query - ---- -kind: CommandPermissions -version: v1 -definition: - commandName: hello - permissions: - - role: admin - allowExecution: true diff --git a/fixtures/ddn/sample_mflix/dataconnectors/.gitkeep b/fixtures/ddn/sample_mflix/dataconnectors/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/fixtures/ddn/sample_mflix/dataconnectors/sample_mflix-types.hml b/fixtures/ddn/sample_mflix/dataconnectors/sample_mflix-types.hml deleted file mode 100644 index dd8459ea..00000000 --- a/fixtures/ddn/sample_mflix/dataconnectors/sample_mflix-types.hml +++ /dev/null @@ -1,83 +0,0 @@ ---- -kind: ScalarType -version: v1 -definition: - name: ObjectId - graphql: - typeName: ObjectId - ---- -kind: ScalarType -version: v1 -definition: - name: Date - graphql: - typeName: Date - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: sample_mflix - dataConnectorScalarType: ObjectId - representation: ObjectId - graphql: - comparisonExpressionTypeName: ObjectIdComparisonExp - ---- -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: ScalarType -version: v1 -definition: - name: ExtendedJson - graphql: - typeName: ExtendedJson - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: sample_mflix - dataConnectorScalarType: Int - representation: Int - graphql: - comparisonExpressionTypeName: IntComparisonExp - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: sample_mflix - dataConnectorScalarType: ExtendedJSON - representation: ExtendedJson - graphql: - comparisonExpressionTypeName: ExtendedJsonComparisonExp - ---- -kind: DataConnectorScalarRepresentation -version: v1 -definition: - dataConnectorName: sample_mflix - dataConnectorScalarType: Float - representation: Float - graphql: - comparisonExpressionTypeName: FloatComparisonExp diff --git a/fixtures/ddn/sample_mflix/dataconnectors/sample_mflix.hml b/fixtures/ddn/sample_mflix/dataconnectors/sample_mflix.hml deleted file mode 100644 index 762746bb..00000000 --- a/fixtures/ddn/sample_mflix/dataconnectors/sample_mflix.hml +++ /dev/null @@ -1,921 +0,0 @@ -kind: DataConnectorLink -version: v1 -definition: - name: sample_mflix - url: - singleUrl: - value: http://localhost:7131 - schema: - version: v0.1 - schema: - scalar_types: - BinData: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: - _eq: - type: equal - _neq: - type: custom - argument_type: - type: named - name: BinData - Boolean: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: - _eq: - type: equal - _neq: - type: custom - argument_type: - type: named - name: Boolean - Date: - aggregate_functions: - count: - result_type: - type: named - name: Int - max: - result_type: - type: named - name: Date - min: - result_type: - type: named - name: Date - comparison_operators: - _eq: - type: equal - _gt: - type: custom - argument_type: - type: named - name: Date - _gte: - type: custom - argument_type: - type: named - name: Date - _lt: - type: custom - argument_type: - type: named - name: Date - _lte: - type: custom - argument_type: - type: named - name: Date - _neq: - type: custom - argument_type: - type: named - name: Date - DbPointer: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: - _eq: - type: equal - _neq: - type: custom - argument_type: - type: named - name: DbPointer - Decimal: - aggregate_functions: - avg: - result_type: - type: named - name: Decimal - count: - result_type: - type: named - name: Int - max: - result_type: - type: named - name: Decimal - min: - result_type: - type: named - name: Decimal - sum: - result_type: - type: named - name: Decimal - comparison_operators: - _eq: - type: equal - _gt: - type: custom - argument_type: - type: named - name: Decimal - _gte: - type: custom - argument_type: - type: named - name: Decimal - _lt: - type: custom - argument_type: - type: named - name: Decimal - _lte: - type: custom - argument_type: - type: named - name: Decimal - _neq: - type: custom - argument_type: - type: named - name: Decimal - ExtendedJSON: - aggregate_functions: {} - comparison_operators: {} - Float: - aggregate_functions: - avg: - result_type: - type: named - name: Float - count: - result_type: - type: named - name: Int - max: - result_type: - type: named - name: Float - min: - result_type: - type: named - name: Float - sum: - result_type: - type: named - name: Float - comparison_operators: - _eq: - type: equal - _gt: - type: custom - argument_type: - type: named - name: Float - _gte: - type: custom - argument_type: - type: named - name: Float - _lt: - type: custom - argument_type: - type: named - name: Float - _lte: - type: custom - argument_type: - type: named - name: Float - _neq: - type: custom - argument_type: - type: named - name: Float - Int: - aggregate_functions: - avg: - result_type: - type: named - name: Int - count: - result_type: - type: named - name: Int - max: - result_type: - type: named - name: Int - min: - result_type: - type: named - name: Int - sum: - result_type: - type: named - name: Int - comparison_operators: - _eq: - type: equal - _gt: - type: custom - argument_type: - type: named - name: Int - _gte: - type: custom - argument_type: - type: named - name: Int - _lt: - type: custom - argument_type: - type: named - name: Int - _lte: - type: custom - argument_type: - type: named - name: Int - _neq: - type: custom - argument_type: - type: named - name: Int - Javascript: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: {} - JavascriptWithScope: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: {} - Long: - aggregate_functions: - avg: - result_type: - type: named - name: Long - count: - result_type: - type: named - name: Int - max: - result_type: - type: named - name: Long - min: - result_type: - type: named - name: Long - sum: - result_type: - type: named - name: Long - comparison_operators: - _eq: - type: equal - _gt: - type: custom - argument_type: - type: named - name: Long - _gte: - type: custom - argument_type: - type: named - name: Long - _lt: - type: custom - argument_type: - type: named - name: Long - _lte: - type: custom - argument_type: - type: named - name: Long - _neq: - type: custom - argument_type: - type: named - name: Long - MaxKey: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: - _eq: - type: equal - _neq: - type: custom - argument_type: - type: named - name: MaxKey - MinKey: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: - _eq: - type: equal - _neq: - type: custom - argument_type: - type: named - name: MinKey - "Null": - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: - _eq: - type: equal - _neq: - type: custom - argument_type: - type: named - name: "Null" - ObjectId: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: - _eq: - type: equal - _neq: - type: custom - argument_type: - type: named - name: ObjectId - Regex: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: {} - String: - aggregate_functions: - count: - result_type: - type: named - name: Int - max: - result_type: - type: named - name: String - min: - result_type: - type: named - name: String - comparison_operators: - _eq: - type: equal - _gt: - type: custom - argument_type: - type: named - name: String - _gte: - type: custom - argument_type: - type: named - name: String - _iregex: - type: custom - argument_type: - type: named - name: String - _lt: - type: custom - argument_type: - type: named - name: String - _lte: - type: custom - argument_type: - type: named - name: String - _neq: - type: custom - argument_type: - type: named - name: String - _regex: - type: custom - argument_type: - type: named - name: String - Symbol: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: - _eq: - type: equal - _neq: - type: custom - argument_type: - type: named - name: Symbol - Timestamp: - aggregate_functions: - count: - result_type: - type: named - name: Int - max: - result_type: - type: named - name: Timestamp - min: - result_type: - type: named - name: Timestamp - comparison_operators: - _eq: - type: equal - _gt: - type: custom - argument_type: - type: named - name: Timestamp - _gte: - type: custom - argument_type: - type: named - name: Timestamp - _lt: - type: custom - argument_type: - type: named - name: Timestamp - _lte: - type: custom - argument_type: - type: named - name: Timestamp - _neq: - type: custom - argument_type: - type: named - name: Timestamp - Undefined: - aggregate_functions: - count: - result_type: - type: named - name: Int - comparison_operators: - _eq: - type: equal - _neq: - type: custom - argument_type: - type: named - name: Undefined - object_types: - comments: - fields: - _id: - type: - type: named - name: ObjectId - date: - type: - type: named - name: Date - email: - type: - type: named - name: String - movie_id: - type: - type: named - name: ObjectId - name: - type: - type: named - name: String - text: - type: - type: named - name: String - movies: - fields: - _id: - type: - type: named - name: ObjectId - awards: - type: - type: named - name: movies_awards - cast: - type: - type: array - element_type: - type: named - name: String - countries: - type: - type: array - element_type: - type: named - name: String - directors: - type: - type: array - element_type: - type: named - name: String - fullplot: - type: - type: nullable - underlying_type: - type: named - name: String - genres: - type: - type: array - element_type: - type: named - name: String - imdb: - type: - type: named - name: movies_imdb - languages: - type: - type: array - element_type: - type: named - name: String - lastupdated: - type: - type: named - name: String - metacritic: - type: - type: nullable - underlying_type: - type: named - name: Int - num_mflix_comments: - type: - type: nullable - underlying_type: - type: named - name: Int - plot: - type: - type: nullable - underlying_type: - type: named - name: String - poster: - type: - type: nullable - underlying_type: - type: named - name: String - rated: - type: - type: nullable - underlying_type: - type: named - name: String - released: - type: - type: named - name: Date - runtime: - type: - type: named - name: Int - title: - type: - type: named - name: String - tomatoes: - type: - type: nullable - underlying_type: - type: named - name: movies_tomatoes - type: - type: - type: named - name: String - writers: - type: - type: array - element_type: - type: named - name: String - year: - type: - type: named - name: Int - movies_awards: - fields: - nominations: - type: - type: named - name: Int - text: - type: - type: named - name: String - wins: - type: - type: named - name: Int - movies_imdb: - fields: - id: - type: - type: named - name: Int - rating: - type: - type: nullable - underlying_type: - type: named - name: Double - votes: - type: - type: named - name: Int - movies_tomatoes: - fields: - boxOffice: - type: - type: nullable - underlying_type: - type: named - name: String - consensus: - type: - type: nullable - underlying_type: - type: named - name: String - critic: - type: - type: nullable - underlying_type: - type: named - name: movies_tomatoes_critic - dvd: - type: - type: nullable - underlying_type: - type: named - name: Date - fresh: - type: - type: nullable - underlying_type: - type: named - name: Int - lastUpdated: - type: - type: named - name: Date - production: - type: - type: nullable - underlying_type: - type: named - name: String - rotten: - type: - type: nullable - underlying_type: - type: named - name: Int - viewer: - type: - type: named - name: movies_tomatoes_viewer - website: - type: - type: nullable - underlying_type: - type: named - name: String - movies_tomatoes_critic: - fields: - meter: - type: - type: named - name: Int - numReviews: - type: - type: named - name: Int - rating: - type: - type: nullable - underlying_type: - type: named - name: Double - movies_tomatoes_viewer: - fields: - meter: - type: - type: named - name: Int - numReviews: - type: - type: named - name: Int - rating: - type: - type: nullable - underlying_type: - type: named - name: Double - sessions: - fields: - _id: - type: - type: named - name: ObjectId - jwt: - type: - type: named - name: String - user_id: - type: - type: named - name: String - theaters: - fields: - _id: - type: - type: named - name: ObjectId - location: - type: - type: named - name: theaters_location - theaterId: - type: - type: named - name: Int - theaters_location: - fields: - address: - type: - type: named - name: theaters_location_address - geo: - type: - type: named - name: theaters_location_geo - theaters_location_address: - fields: - city: - type: - type: named - name: String - state: - type: - type: named - name: String - street1: - type: - type: named - name: String - street2: - type: - type: nullable - underlying_type: - type: named - name: String - zipcode: - type: - type: named - name: String - theaters_location_geo: - fields: - coordinates: - type: - type: array - element_type: - type: named - name: Float - type: - type: - type: named - name: String - users: - fields: - _id: - type: - type: named - name: ObjectId - email: - type: - type: named - name: String - name: - type: - type: named - name: String - password: - type: - type: named - name: String - TitleWordFrequency: - fields: - _id: { type: { type: named, name: String } } - count: { type: { type: named, name: Int } } - collections: - - name: comments - arguments: {} - type: comments - uniqueness_constraints: - comments_id: - unique_columns: - - _id - foreign_keys: {} - - name: movies - arguments: {} - type: movies - uniqueness_constraints: - movies_id: - unique_columns: - - _id - foreign_keys: {} - - name: sessions - arguments: {} - type: sessions - uniqueness_constraints: - sessions_id: - unique_columns: - - _id - foreign_keys: {} - - name: theaters - arguments: {} - type: theaters - uniqueness_constraints: - theaters_id: - unique_columns: - - _id - foreign_keys: {} - - name: users - arguments: {} - type: users - uniqueness_constraints: - users_id: - unique_columns: - - _id - foreign_keys: {} - - name: title_word_frequency - arguments: {} - type: TitleWordFrequency - uniqueness_constraints: - title_word_frequency_id: - unique_columns: - - _id - foreign_keys: {} - functions: - - name: hello - description: Basic test of native queries - result_type: { type: named, name: String } - arguments: - name: { type: { type: named, name: String } } - procedures: [] - capabilities: - version: 0.1.1 - capabilities: - query: - aggregates: {} - variables: {} - explain: {} - mutation: {} - relationships: {} diff --git a/fixtures/ddn/sample_mflix/models/Comments.hml b/fixtures/ddn/sample_mflix/models/Comments.hml deleted file mode 100644 index 5e0cba4f..00000000 --- a/fixtures/ddn/sample_mflix/models/Comments.hml +++ /dev/null @@ -1,157 +0,0 @@ ---- -kind: ObjectType -version: v1 -definition: - name: Comments - fields: - - name: id - type: ObjectId! - - name: date - type: Date! - - name: email - type: String! - - name: movieId - type: ObjectId! - - name: name - type: String! - - name: text - type: String! - graphql: - typeName: Comments - inputTypeName: CommentsInput - dataConnectorTypeMapping: - - dataConnectorName: sample_mflix - dataConnectorObjectType: comments - fieldMapping: - id: - column: - name: _id - date: - column: - name: date - email: - column: - name: email - movieId: - column: - name: movie_id - name: - column: - name: name - text: - column: - name: text - ---- -kind: TypePermissions -version: v1 -definition: - typeName: Comments - permissions: - - role: admin - output: - allowedFields: - - id - - date - - email - - movieId - - name - - text - - role: user - output: - allowedFields: - - id - - date - - email - - movieId - - name - - text - ---- -kind: ObjectBooleanExpressionType -version: v1 -definition: - name: CommentsBoolExp - objectType: Comments - dataConnectorName: sample_mflix - dataConnectorObjectType: comments - comparableFields: - - fieldName: id - operators: - enableAll: true - - fieldName: date - operators: - enableAll: true - - fieldName: email - operators: - enableAll: true - - fieldName: movieId - operators: - enableAll: true - - fieldName: name - operators: - enableAll: true - - fieldName: text - operators: - enableAll: true - graphql: - typeName: CommentsBoolExp - ---- -kind: Model -version: v1 -definition: - name: Comments - objectType: Comments - source: - dataConnectorName: sample_mflix - collection: comments - filterExpressionType: CommentsBoolExp - orderableFields: - - fieldName: id - orderByDirections: - enableAll: true - - fieldName: date - orderByDirections: - enableAll: true - - fieldName: email - orderByDirections: - enableAll: true - - fieldName: movieId - orderByDirections: - enableAll: true - - fieldName: name - orderByDirections: - enableAll: true - - fieldName: text - orderByDirections: - enableAll: true - graphql: - selectMany: - queryRootField: comments - selectUniques: - - queryRootField: commentsById - uniqueIdentifier: - - id - orderByExpressionType: CommentsOrderBy - ---- -kind: ModelPermissions -version: v1 -definition: - modelName: Comments - permissions: - - role: admin - select: - filter: null - - role: user - select: - filter: - relationship: - name: user - predicate: - fieldComparison: - field: id - operator: _eq - value: - sessionVariable: x-hasura-user-id diff --git a/fixtures/ddn/sample_mflix/models/Movies.hml b/fixtures/ddn/sample_mflix/models/Movies.hml deleted file mode 100644 index a4c6f5de..00000000 --- a/fixtures/ddn/sample_mflix/models/Movies.hml +++ /dev/null @@ -1,511 +0,0 @@ ---- -kind: ObjectType -version: v1 -definition: - name: MoviesAwards - fields: - - name: nominations - type: Int! - - name: text - type: String! - - name: wins - type: Int! - graphql: - typeName: MoviesAwards - inputTypeName: MoviesAwardsInput - dataConnectorTypeMapping: - - dataConnectorName: sample_mflix - dataConnectorObjectType: movies_awards - ---- -kind: TypePermissions -version: v1 -definition: - typeName: MoviesAwards - permissions: - - role: admin - output: - allowedFields: - - nominations - - text - - wins - ---- -kind: ObjectType -version: v1 -definition: - name: MoviesImdb - fields: - - name: id - type: Int! - - name: rating - type: ExtendedJson - - name: votes - type: Int! - graphql: - typeName: MoviesImdb - inputTypeName: MoviesImdbInput - dataConnectorTypeMapping: - - dataConnectorName: sample_mflix - dataConnectorObjectType: movies_imdb - ---- -kind: TypePermissions -version: v1 -definition: - typeName: MoviesImdb - permissions: - - role: admin - output: - allowedFields: - - id - - rating - - votes - ---- -kind: ObjectType -version: v1 -definition: - name: MoviesTomatoesCritic - fields: - - name: meter - type: Int! - - name: numReviews - type: Int! - - name: rating - type: ExtendedJson - graphql: - typeName: MoviesTomatoesCritic - inputTypeName: MoviesTomatoesCriticInput - dataConnectorTypeMapping: - - dataConnectorName: sample_mflix - dataConnectorObjectType: movies_tomatoes_critic - ---- -kind: TypePermissions -version: v1 -definition: - typeName: MoviesTomatoesCritic - permissions: - - role: admin - output: - allowedFields: - - meter - - numReviews - - rating - ---- -kind: ObjectType -version: v1 -definition: - name: MoviesTomatoesViewer - fields: - - name: meter - type: Int! - - name: numReviews - type: Int! - - name: rating - type: ExtendedJson - graphql: - typeName: MoviesTomatoesViewer - inputTypeName: MoviesTomatoesViewerInput - dataConnectorTypeMapping: - - dataConnectorName: sample_mflix - dataConnectorObjectType: movies_tomatoes_viewer - ---- -kind: TypePermissions -version: v1 -definition: - typeName: MoviesTomatoesViewer - permissions: - - role: admin - output: - allowedFields: - - meter - - numReviews - - rating - ---- -kind: ObjectType -version: v1 -definition: - name: MoviesTomatoes - fields: - - name: boxOffice - type: String - - name: consensus - type: String - - name: critic - type: MoviesTomatoesCritic - - name: dvd - type: Date - - name: fresh - type: Int - - name: lastUpdated - type: Date! - - name: production - type: String - - name: rotten - type: Int - - name: viewer - type: MoviesTomatoesViewer! - - name: website - type: String - graphql: - typeName: MoviesTomatoes - inputTypeName: MoviesTomatoesInput - dataConnectorTypeMapping: - - dataConnectorName: sample_mflix - dataConnectorObjectType: movies_tomatoes - ---- -kind: TypePermissions -version: v1 -definition: - typeName: MoviesTomatoes - permissions: - - role: admin - output: - allowedFields: - - boxOffice - - consensus - - critic - - dvd - - fresh - - lastUpdated - - production - - rotten - - viewer - - website - ---- -kind: ObjectType -version: v1 -definition: - name: Movies - fields: - - name: id - type: ObjectId! - - name: awards - type: MoviesAwards! - - name: cast - type: "[String!]!" - - name: countries - type: "[String!]!" - - name: directors - type: "[String!]!" - - name: fullplot - type: String - - name: genres - type: "[String!]!" - - name: imdb - type: MoviesImdb! - - name: languages - type: "[String!]!" - - name: lastupdated - type: String! - - name: metacritic - type: Int - - name: numMflixComments - type: Int - - name: plot - type: String - - name: poster - type: String - - name: rated - type: String - - name: released - type: Date! - - name: runtime - type: Int! - - name: title - type: String! - - name: tomatoes - type: MoviesTomatoes - - name: type - type: String! - - name: writers - type: "[String!]!" - - name: year - type: Int! - graphql: - typeName: Movies - inputTypeName: MoviesInput - dataConnectorTypeMapping: - - dataConnectorName: sample_mflix - dataConnectorObjectType: movies - fieldMapping: - id: - column: - name: _id - awards: - column: - name: awards - cast: - column: - name: cast - countries: - column: - name: countries - directors: - column: - name: directors - fullplot: - column: - name: fullplot - genres: - column: - name: genres - imdb: - column: - name: imdb - languages: - column: - name: languages - lastupdated: - column: - name: lastupdated - metacritic: - column: - name: metacritic - numMflixComments: - column: - name: num_mflix_comments - plot: - column: - name: plot - poster: - column: - name: poster - rated: - column: - name: rated - released: - column: - name: released - runtime: - column: - name: runtime - title: - column: - name: title - tomatoes: - column: - name: tomatoes - type: - column: - name: type - writers: - column: - name: writers - year: - column: - name: year - ---- -kind: TypePermissions -version: v1 -definition: - typeName: Movies - permissions: - - role: admin - output: - allowedFields: - - id - - awards - - cast - - countries - - directors - - fullplot - - genres - - imdb - - languages - - lastupdated - - metacritic - - numMflixComments - - plot - - poster - - rated - - released - - runtime - - title - - tomatoes - - type - - writers - - year - ---- -kind: ObjectBooleanExpressionType -version: v1 -definition: - name: MoviesBoolExp - objectType: Movies - dataConnectorName: sample_mflix - dataConnectorObjectType: movies - comparableFields: - - fieldName: id - operators: - enableAll: true - - fieldName: awards - operators: - enableAll: true - - fieldName: cast - operators: - enableAll: true - - fieldName: countries - operators: - enableAll: true - - fieldName: directors - operators: - enableAll: true - - fieldName: fullplot - operators: - enableAll: true - - fieldName: genres - operators: - enableAll: true - - fieldName: imdb - operators: - enableAll: true - - fieldName: languages - operators: - enableAll: true - - fieldName: lastupdated - operators: - enableAll: true - - fieldName: metacritic - operators: - enableAll: true - - fieldName: numMflixComments - operators: - enableAll: true - - fieldName: plot - operators: - enableAll: true - - fieldName: poster - operators: - enableAll: true - - fieldName: rated - operators: - enableAll: true - - fieldName: released - operators: - enableAll: true - - fieldName: runtime - operators: - enableAll: true - - fieldName: title - operators: - enableAll: true - - fieldName: tomatoes - operators: - enableAll: true - - fieldName: type - operators: - enableAll: true - - fieldName: writers - operators: - enableAll: true - - fieldName: year - operators: - enableAll: true - graphql: - typeName: MoviesBoolExp - ---- -kind: Model -version: v1 -definition: - name: Movies - objectType: Movies - source: - dataConnectorName: sample_mflix - collection: movies - filterExpressionType: MoviesBoolExp - orderableFields: - - fieldName: id - orderByDirections: - enableAll: true - - fieldName: awards - orderByDirections: - enableAll: true - - fieldName: cast - orderByDirections: - enableAll: true - - fieldName: countries - orderByDirections: - enableAll: true - - fieldName: directors - orderByDirections: - enableAll: true - - fieldName: fullplot - orderByDirections: - enableAll: true - - fieldName: genres - orderByDirections: - enableAll: true - - fieldName: imdb - orderByDirections: - enableAll: true - - fieldName: languages - orderByDirections: - enableAll: true - - fieldName: lastupdated - orderByDirections: - enableAll: true - - fieldName: metacritic - orderByDirections: - enableAll: true - - fieldName: numMflixComments - orderByDirections: - enableAll: true - - fieldName: plot - orderByDirections: - enableAll: true - - fieldName: poster - orderByDirections: - enableAll: true - - fieldName: rated - orderByDirections: - enableAll: true - - fieldName: released - orderByDirections: - enableAll: true - - fieldName: runtime - orderByDirections: - enableAll: true - - fieldName: title - orderByDirections: - enableAll: true - - fieldName: tomatoes - orderByDirections: - enableAll: true - - fieldName: type - orderByDirections: - enableAll: true - - fieldName: writers - orderByDirections: - enableAll: true - - fieldName: year - orderByDirections: - enableAll: true - graphql: - selectMany: - queryRootField: movies - selectUniques: - - queryRootField: moviesById - uniqueIdentifier: - - id - orderByExpressionType: MoviesOrderBy - ---- -kind: ModelPermissions -version: v1 -definition: - modelName: Movies - permissions: - - role: admin - select: - filter: null - diff --git a/fixtures/ddn/sample_mflix/models/Sessions.hml b/fixtures/ddn/sample_mflix/models/Sessions.hml deleted file mode 100644 index 50f3969f..00000000 --- a/fixtures/ddn/sample_mflix/models/Sessions.hml +++ /dev/null @@ -1,102 +0,0 @@ ---- -kind: ObjectType -version: v1 -definition: - name: Sessions - fields: - - name: id - type: ObjectId! - - name: jwt - type: String! - - name: userId - type: String! - graphql: - typeName: Sessions - inputTypeName: SessionsInput - dataConnectorTypeMapping: - - dataConnectorName: sample_mflix - dataConnectorObjectType: sessions - fieldMapping: - id: - column: - name: _id - jwt: - column: - name: jwt - userId: - column: - name: user_id - ---- -kind: TypePermissions -version: v1 -definition: - typeName: Sessions - permissions: - - role: admin - output: - allowedFields: - - id - - jwt - - userId - ---- -kind: ObjectBooleanExpressionType -version: v1 -definition: - name: SessionsBoolExp - objectType: Sessions - dataConnectorName: sample_mflix - dataConnectorObjectType: sessions - comparableFields: - - fieldName: id - operators: - enableAll: true - - fieldName: jwt - operators: - enableAll: true - - fieldName: userId - operators: - enableAll: true - graphql: - typeName: SessionsBoolExp - ---- -kind: Model -version: v1 -definition: - name: Sessions - objectType: Sessions - source: - dataConnectorName: sample_mflix - collection: sessions - filterExpressionType: SessionsBoolExp - orderableFields: - - fieldName: id - orderByDirections: - enableAll: true - - fieldName: jwt - orderByDirections: - enableAll: true - - fieldName: userId - orderByDirections: - enableAll: true - graphql: - selectMany: - queryRootField: sessions - selectUniques: - - queryRootField: sessionsById - uniqueIdentifier: - - id - orderByExpressionType: SessionsOrderBy - ---- -kind: ModelPermissions -version: v1 -definition: - modelName: Sessions - permissions: - - role: admin - select: - filter: null - diff --git a/fixtures/ddn/sample_mflix/models/Theaters.hml b/fixtures/ddn/sample_mflix/models/Theaters.hml deleted file mode 100644 index 0c534319..00000000 --- a/fixtures/ddn/sample_mflix/models/Theaters.hml +++ /dev/null @@ -1,198 +0,0 @@ ---- -kind: ObjectType -version: v1 -definition: - name: TheatersLocationAddress - fields: - - name: city - type: String! - - name: state - type: String! - - name: street1 - type: String! - - name: street2 - type: String - - name: zipcode - type: String! - graphql: - typeName: TheatersLocationAddress - inputTypeName: TheatersLocationAddressInput - dataConnectorTypeMapping: - - dataConnectorName: sample_mflix - dataConnectorObjectType: theaters_location_address - ---- -kind: TypePermissions -version: v1 -definition: - typeName: TheatersLocationAddress - permissions: - - role: admin - output: - allowedFields: - - city - - state - - street1 - - street2 - - zipcode - ---- -kind: ObjectType -version: v1 -definition: - name: TheatersLocationGeo - fields: - - name: coordinates - type: "[Float!]!" - - name: type - type: String! - graphql: - typeName: TheatersLocationGeo - inputTypeName: TheatersLocationGeoInput - dataConnectorTypeMapping: - - dataConnectorName: sample_mflix - dataConnectorObjectType: theaters_location_geo - ---- -kind: TypePermissions -version: v1 -definition: - typeName: TheatersLocationGeo - permissions: - - role: admin - output: - allowedFields: - - coordinates - - type - ---- -kind: ObjectType -version: v1 -definition: - name: TheatersLocation - fields: - - name: address - type: TheatersLocationAddress! - - name: geo - type: TheatersLocationGeo! - graphql: - typeName: TheatersLocation - inputTypeName: TheatersLocationInput - dataConnectorTypeMapping: - - dataConnectorName: sample_mflix - dataConnectorObjectType: theaters_location - ---- -kind: TypePermissions -version: v1 -definition: - typeName: TheatersLocation - permissions: - - role: admin - output: - allowedFields: - - address - - geo - ---- -kind: ObjectType -version: v1 -definition: - name: Theaters - fields: - - name: id - type: ObjectId! - - name: location - type: TheatersLocation! - - name: theaterId - type: Int! - graphql: - typeName: Theaters - inputTypeName: TheatersInput - dataConnectorTypeMapping: - - dataConnectorName: sample_mflix - dataConnectorObjectType: theaters - fieldMapping: - id: - column: - name: _id - location: - column: - name: location - theaterId: - column: - name: theaterId - ---- -kind: TypePermissions -version: v1 -definition: - typeName: Theaters - permissions: - - role: admin - output: - allowedFields: - - id - - location - - theaterId - ---- -kind: ObjectBooleanExpressionType -version: v1 -definition: - name: TheatersBoolExp - objectType: Theaters - dataConnectorName: sample_mflix - dataConnectorObjectType: theaters - comparableFields: - - fieldName: id - operators: - enableAll: true - - fieldName: location - operators: - enableAll: true - - fieldName: theaterId - operators: - enableAll: true - graphql: - typeName: TheatersBoolExp - ---- -kind: Model -version: v1 -definition: - name: Theaters - objectType: Theaters - source: - dataConnectorName: sample_mflix - collection: theaters - filterExpressionType: TheatersBoolExp - orderableFields: - - fieldName: id - orderByDirections: - enableAll: true - - fieldName: location - orderByDirections: - enableAll: true - - fieldName: theaterId - orderByDirections: - enableAll: true - graphql: - selectMany: - queryRootField: theaters - selectUniques: - - queryRootField: theatersById - uniqueIdentifier: - - id - orderByExpressionType: TheatersOrderBy - ---- -kind: ModelPermissions -version: v1 -definition: - modelName: Theaters - permissions: - - role: admin - select: - filter: null - diff --git a/fixtures/ddn/sample_mflix/models/TitleWordFrequency.hml b/fixtures/ddn/sample_mflix/models/TitleWordFrequency.hml deleted file mode 100644 index a1a58c7e..00000000 --- a/fixtures/ddn/sample_mflix/models/TitleWordFrequency.hml +++ /dev/null @@ -1,90 +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: ObjectBooleanExpressionType -version: v1 -definition: - name: TitleWordFrequencyBoolExp - objectType: TitleWordFrequency - dataConnectorName: sample_mflix - dataConnectorObjectType: TitleWordFrequency - comparableFields: - - fieldName: word - operators: - enableAll: true - - fieldName: count - operators: - enableAll: true - graphql: - typeName: TitleWordFrequencyBoolExp - ---- -kind: Model -version: v1 -definition: - name: TitleWordFrequency - objectType: TitleWordFrequency - source: - dataConnectorName: sample_mflix - collection: title_word_frequency - filterExpressionType: TitleWordFrequencyBoolExp - 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 - ---- -kind: ModelPermissions -version: v1 -definition: - modelName: TitleWordFrequency - permissions: - - role: admin - select: - filter: null - diff --git a/fixtures/ddn/sample_mflix/models/Users.hml b/fixtures/ddn/sample_mflix/models/Users.hml deleted file mode 100644 index 48ba8510..00000000 --- a/fixtures/ddn/sample_mflix/models/Users.hml +++ /dev/null @@ -1,127 +0,0 @@ ---- -kind: ObjectType -version: v1 -definition: - name: Users - fields: - - name: id - type: ObjectId! - - name: email - type: String! - - name: name - type: String! - - name: password - type: String! - graphql: - typeName: Users - inputTypeName: UsersInput - dataConnectorTypeMapping: - - dataConnectorName: sample_mflix - dataConnectorObjectType: users - fieldMapping: - id: - column: - name: _id - email: - column: - name: email - name: - column: - name: name - password: - column: - name: password - ---- -kind: TypePermissions -version: v1 -definition: - typeName: Users - permissions: - - role: admin - output: - allowedFields: - - id - - email - - name - - password - - role: user - output: - allowedFields: - - id - - email - - name - ---- -kind: ObjectBooleanExpressionType -version: v1 -definition: - name: UsersBoolExp - objectType: Users - dataConnectorName: sample_mflix - dataConnectorObjectType: users - comparableFields: - - fieldName: id - operators: - enableAll: true - - fieldName: email - operators: - enableAll: true - - fieldName: name - operators: - enableAll: true - - fieldName: password - operators: - enableAll: true - graphql: - typeName: UsersBoolExp - ---- -kind: Model -version: v1 -definition: - name: Users - objectType: Users - source: - dataConnectorName: sample_mflix - collection: users - filterExpressionType: UsersBoolExp - orderableFields: - - fieldName: id - orderByDirections: - enableAll: true - - fieldName: email - orderByDirections: - enableAll: true - - fieldName: name - orderByDirections: - enableAll: true - - fieldName: password - orderByDirections: - enableAll: true - graphql: - selectMany: - queryRootField: users - selectUniques: - - queryRootField: usersById - uniqueIdentifier: - - id - orderByExpressionType: UsersOrderBy - ---- -kind: ModelPermissions -version: v1 -definition: - modelName: Users - permissions: - - role: admin - select: - filter: null - - role: user - select: - filter: - fieldComparison: - field: id - operator: _eq - value: - sessionVariable: x-hasura-user-id diff --git a/fixtures/ddn/sample_mflix/relationships/movie_comments.hml b/fixtures/ddn/sample_mflix/relationships/movie_comments.hml deleted file mode 100644 index fdb475b4..00000000 --- a/fixtures/ddn/sample_mflix/relationships/movie_comments.hml +++ /dev/null @@ -1,35 +0,0 @@ -kind: Relationship -version: v1 -definition: - name: comments - source: Movies - target: - model: - name: Comments - relationshipType: Array - mapping: - - source: - fieldPath: - - fieldName: id - target: - modelField: - - fieldName: movieId - ---- -kind: Relationship -version: v1 -definition: - name: movie - source: Comments - target: - model: - name: Movies - relationshipType: Object - mapping: - - source: - fieldPath: - - fieldName: movieId - target: - modelField: - - fieldName: id - diff --git a/fixtures/ddn/sample_mflix/relationships/user_comments.hml b/fixtures/ddn/sample_mflix/relationships/user_comments.hml deleted file mode 100644 index 25d5304d..00000000 --- a/fixtures/ddn/sample_mflix/relationships/user_comments.hml +++ /dev/null @@ -1,34 +0,0 @@ -kind: Relationship -version: v1 -definition: - name: comments - source: Users - target: - model: - name: Comments - relationshipType: Array - mapping: - - source: - fieldPath: - - fieldName: email - target: - modelField: - - fieldName: email - ---- -kind: Relationship -version: v1 -definition: - name: user - source: Comments - target: - model: - name: Users - relationshipType: Object - mapping: - - source: - fieldPath: - - fieldName: email - target: - modelField: - - fieldName: email From d0f9b9feab725b55a49fe5cc6aa43513927f1693 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Tue, 9 Jul 2024 18:12:33 -0700 Subject: [PATCH 29/34] remove some stuff --- fixtures/hasura/.env.engine | 6 ---- fixtures/hasura/README.md | 8 ++--- .../{.env.chinook.local => .env.chinook} | 0 .../chinook/connector/chinook/.ddnignore | 2 +- .../connector/chinook/{.env.cloud => .env} | 0 .../chinook/connector/chinook/.env.local | 3 -- .../connector/chinook/connector.local.yaml | 8 ----- .../{connector.cloud.yaml => connector.yaml} | 2 +- .../chinook/docker-compose.chinook.yaml | 21 ----------- fixtures/hasura/otel-collector-config.yaml | 35 ------------------- ...v.sample_mflix.cloud => .env.sample_mflix} | 0 .../sample_mflix/.env.sample_mflix.local | 1 - .../connector/sample_mflix/.ddnignore | 2 +- .../sample_mflix/{.env.cloud => .env} | 0 .../connector/sample_mflix/.env.local | 3 -- .../sample_mflix/connector.local.yaml | 8 ----- .../{connector.cloud.yaml => connector.yaml} | 2 +- .../docker-compose.sample_mflix.yaml | 21 ----------- fixtures/hasura/supergraph.cloud.yaml | 7 ---- ...{supergraph.local.yaml => supergraph.yaml} | 0 20 files changed, 8 insertions(+), 121 deletions(-) delete mode 100644 fixtures/hasura/.env.engine rename fixtures/hasura/chinook/{.env.chinook.local => .env.chinook} (100%) rename fixtures/hasura/chinook/connector/chinook/{.env.cloud => .env} (100%) delete mode 100644 fixtures/hasura/chinook/connector/chinook/.env.local delete mode 100644 fixtures/hasura/chinook/connector/chinook/connector.local.yaml rename fixtures/hasura/chinook/connector/chinook/{connector.cloud.yaml => connector.yaml} (84%) delete mode 100644 fixtures/hasura/chinook/connector/chinook/docker-compose.chinook.yaml delete mode 100644 fixtures/hasura/otel-collector-config.yaml rename fixtures/hasura/sample_mflix/{.env.sample_mflix.cloud => .env.sample_mflix} (100%) delete mode 100644 fixtures/hasura/sample_mflix/.env.sample_mflix.local rename fixtures/hasura/sample_mflix/connector/sample_mflix/{.env.cloud => .env} (100%) delete mode 100644 fixtures/hasura/sample_mflix/connector/sample_mflix/.env.local delete mode 100644 fixtures/hasura/sample_mflix/connector/sample_mflix/connector.local.yaml rename fixtures/hasura/sample_mflix/connector/sample_mflix/{connector.cloud.yaml => connector.yaml} (85%) delete mode 100644 fixtures/hasura/sample_mflix/connector/sample_mflix/docker-compose.sample_mflix.yaml delete mode 100644 fixtures/hasura/supergraph.cloud.yaml rename fixtures/hasura/{supergraph.local.yaml => supergraph.yaml} (100%) diff --git a/fixtures/hasura/.env.engine b/fixtures/hasura/.env.engine deleted file mode 100644 index 42ca016a..00000000 --- a/fixtures/hasura/.env.engine +++ /dev/null @@ -1,6 +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 -CORS_ALLOW_ORIGIN=https://console.arusah.com diff --git a/fixtures/hasura/README.md b/fixtures/hasura/README.md index 2d155360..8bf6bfbb 100644 --- a/fixtures/hasura/README.md +++ b/fixtures/hasura/README.md @@ -19,15 +19,15 @@ commands are repeated for each subgraph + connector combination. Run introspection to update connector configuration: ```sh -$ ddn connector introspect --connector sample_mflix/connector/sample_mflix/connector.local.yaml +$ ddn connector introspect --connector sample_mflix/connector/sample_mflix/connector.yaml -$ ddn connector introspect --connector chinook/connector/chinook/connector.local.yaml +$ ddn connector introspect --connector chinook/connector/chinook/connector.yaml ``` Update ddn based on connector configuration: ```sh -$ ddn connector-link update sample_mflix --subgraph sample_mflix/subgraph.yaml --env-file sample_mflix/.env.sample_mflix.local --add-all-resources +$ 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 chinook --subgraph chinook/subgraph.yaml --env-file chinook/.env.chinook.local --add-all-resources +$ ddn connector-link update chinook --subgraph chinook/subgraph.yaml --env-file chinook/.env.chinook --add-all-resources ``` diff --git a/fixtures/hasura/chinook/.env.chinook.local b/fixtures/hasura/chinook/.env.chinook similarity index 100% rename from fixtures/hasura/chinook/.env.chinook.local rename to fixtures/hasura/chinook/.env.chinook diff --git a/fixtures/hasura/chinook/connector/chinook/.ddnignore b/fixtures/hasura/chinook/connector/chinook/.ddnignore index 3615120b..4c49bd78 100644 --- a/fixtures/hasura/chinook/connector/chinook/.ddnignore +++ b/fixtures/hasura/chinook/connector/chinook/.ddnignore @@ -1 +1 @@ -.env.* +.env diff --git a/fixtures/hasura/chinook/connector/chinook/.env.cloud b/fixtures/hasura/chinook/connector/chinook/.env similarity index 100% rename from fixtures/hasura/chinook/connector/chinook/.env.cloud rename to fixtures/hasura/chinook/connector/chinook/.env diff --git a/fixtures/hasura/chinook/connector/chinook/.env.local b/fixtures/hasura/chinook/connector/chinook/.env.local deleted file mode 100644 index 7f6640d6..00000000 --- a/fixtures/hasura/chinook/connector/chinook/.env.local +++ /dev/null @@ -1,3 +0,0 @@ -OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://local.hasura.dev:4317 -OTEL_SERVICE_NAME=chinook_chinook -MONGODB_DATABASE_URI="mongodb://localhost/chinook" diff --git a/fixtures/hasura/chinook/connector/chinook/connector.local.yaml b/fixtures/hasura/chinook/connector/chinook/connector.local.yaml deleted file mode 100644 index 786b857e..00000000 --- a/fixtures/hasura/chinook/connector/chinook/connector.local.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.local diff --git a/fixtures/hasura/chinook/connector/chinook/connector.cloud.yaml b/fixtures/hasura/chinook/connector/chinook/connector.yaml similarity index 84% rename from fixtures/hasura/chinook/connector/chinook/connector.cloud.yaml rename to fixtures/hasura/chinook/connector/chinook/connector.yaml index 786b857e..078bf6e8 100644 --- a/fixtures/hasura/chinook/connector/chinook/connector.cloud.yaml +++ b/fixtures/hasura/chinook/connector/chinook/connector.yaml @@ -5,4 +5,4 @@ definition: subgraph: chinook source: hasura/mongodb:v0.1.0 context: . - envFile: .env.local + envFile: .env diff --git a/fixtures/hasura/chinook/connector/chinook/docker-compose.chinook.yaml b/fixtures/hasura/chinook/connector/chinook/docker-compose.chinook.yaml deleted file mode 100644 index dd449731..00000000 --- a/fixtures/hasura/chinook/connector/chinook/docker-compose.chinook.yaml +++ /dev/null @@ -1,21 +0,0 @@ -services: - chinook_chinook: - build: - context: . - dockerfile_inline: |- - FROM ghcr.io/hasura/ndc-mongodb:v0.0.6 - COPY ./ /etc/connector - develop: - watch: - - path: ./ - action: sync+restart - target: /etc/connector - env_file: - - .env.local - extra_hosts: - - local.hasura.dev=host-gateway - ports: - - mode: ingress - target: 8080 - published: "8081" - protocol: tcp diff --git a/fixtures/hasura/otel-collector-config.yaml b/fixtures/hasura/otel-collector-config.yaml deleted file mode 100644 index fa4a879e..00000000 --- a/fixtures/hasura/otel-collector-config.yaml +++ /dev/null @@ -1,35 +0,0 @@ -exporters: - otlp: - endpoint: https://gateway.otlp.hasura.io:443 - headers: - Authorization: pat ${env:HASURA_DDN_PAT} -processors: - batch: {} -receivers: - otlp: - protocols: - grpc: {} - http: {} -service: - pipelines: - logs: - exporters: - - otlp - processors: - - batch - receivers: - - otlp - metrics: - exporters: - - otlp - processors: - - batch - receivers: - - otlp - traces: - exporters: - - otlp - processors: - - batch - receivers: - - otlp diff --git a/fixtures/hasura/sample_mflix/.env.sample_mflix.cloud b/fixtures/hasura/sample_mflix/.env.sample_mflix similarity index 100% rename from fixtures/hasura/sample_mflix/.env.sample_mflix.cloud rename to fixtures/hasura/sample_mflix/.env.sample_mflix diff --git a/fixtures/hasura/sample_mflix/.env.sample_mflix.local b/fixtures/hasura/sample_mflix/.env.sample_mflix.local deleted file mode 100644 index e003fd5a..00000000 --- a/fixtures/hasura/sample_mflix/.env.sample_mflix.local +++ /dev/null @@ -1 +0,0 @@ -SAMPLE_MFLIX_CONNECTOR_URL='http://localhost:7130' diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/.ddnignore b/fixtures/hasura/sample_mflix/connector/sample_mflix/.ddnignore index 81a38be6..4c49bd78 100644 --- a/fixtures/hasura/sample_mflix/connector/sample_mflix/.ddnignore +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/.ddnignore @@ -1 +1 @@ -.env* +.env diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/.env.cloud b/fixtures/hasura/sample_mflix/connector/sample_mflix/.env similarity index 100% rename from fixtures/hasura/sample_mflix/connector/sample_mflix/.env.cloud rename to fixtures/hasura/sample_mflix/connector/sample_mflix/.env diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/.env.local b/fixtures/hasura/sample_mflix/connector/sample_mflix/.env.local deleted file mode 100644 index 884073bf..00000000 --- a/fixtures/hasura/sample_mflix/connector/sample_mflix/.env.local +++ /dev/null @@ -1,3 +0,0 @@ -OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://local.hasura.dev:4317 -OTEL_SERVICE_NAME=sample_mflix_sample_mflix -MONGODB_DATABASE_URI="mongodb://localhost/sample_mflix" diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/connector.local.yaml b/fixtures/hasura/sample_mflix/connector/sample_mflix/connector.local.yaml deleted file mode 100644 index 8407afbb..00000000 --- a/fixtures/hasura/sample_mflix/connector/sample_mflix/connector.local.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.local diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/connector.cloud.yaml b/fixtures/hasura/sample_mflix/connector/sample_mflix/connector.yaml similarity index 85% rename from fixtures/hasura/sample_mflix/connector/sample_mflix/connector.cloud.yaml rename to fixtures/hasura/sample_mflix/connector/sample_mflix/connector.yaml index 8d69912c..052dfcd6 100644 --- a/fixtures/hasura/sample_mflix/connector/sample_mflix/connector.cloud.yaml +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/connector.yaml @@ -5,4 +5,4 @@ definition: subgraph: sample_mflix source: hasura/mongodb:v0.1.0 context: . - envFile: .env.cloud + envFile: .env diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/docker-compose.sample_mflix.yaml b/fixtures/hasura/sample_mflix/connector/sample_mflix/docker-compose.sample_mflix.yaml deleted file mode 100644 index 40c45c13..00000000 --- a/fixtures/hasura/sample_mflix/connector/sample_mflix/docker-compose.sample_mflix.yaml +++ /dev/null @@ -1,21 +0,0 @@ -services: - sample_mflix_sample_mflix: - build: - context: . - dockerfile_inline: |- - FROM ghcr.io/hasura/ndc-mongodb:v0.0.6 - COPY ./ /etc/connector - develop: - watch: - - path: ./ - action: sync+restart - target: /etc/connector - env_file: - - .env.local - extra_hosts: - - local.hasura.dev=host-gateway - ports: - - mode: ingress - target: 8080 - published: "8081" - protocol: tcp diff --git a/fixtures/hasura/supergraph.cloud.yaml b/fixtures/hasura/supergraph.cloud.yaml deleted file mode 100644 index 2e63fc09..00000000 --- a/fixtures/hasura/supergraph.cloud.yaml +++ /dev/null @@ -1,7 +0,0 @@ -kind: Supergraph -version: v2 -definition: - subgraphs: - - globals/subgraph.cloud.yaml - - chinook/subgraph.cloud.yaml - - sample_mflix/subgraph.cloud.yaml diff --git a/fixtures/hasura/supergraph.local.yaml b/fixtures/hasura/supergraph.yaml similarity index 100% rename from fixtures/hasura/supergraph.local.yaml rename to fixtures/hasura/supergraph.yaml From 9b60698438505931c56a9160cebf852b7f9282a4 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Tue, 9 Jul 2024 18:23:56 -0700 Subject: [PATCH 30/34] only one Double! --- fixtures/hasura/chinook/metadata/commands/InsertArtist.hml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fixtures/hasura/chinook/metadata/commands/InsertArtist.hml b/fixtures/hasura/chinook/metadata/commands/InsertArtist.hml index 6e5c835e..a538819c 100644 --- a/fixtures/hasura/chinook/metadata/commands/InsertArtist.hml +++ b/fixtures/hasura/chinook/metadata/commands/InsertArtist.hml @@ -40,7 +40,7 @@ definition: inputTypeName: InsertArtistInput fields: - name: ok - type: Double! + type: Chinook_Double! - name: n type: Int! dataConnectorTypeMapping: From 87f547bf3a80d3a080b11a4e7ab03fba771d0b4a Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Tue, 9 Jul 2024 18:32:03 -0700 Subject: [PATCH 31/34] remove unused env vars --- fixtures/hasura/chinook/connector/chinook/.env | 2 -- fixtures/hasura/sample_mflix/connector/sample_mflix/.env | 2 -- 2 files changed, 4 deletions(-) diff --git a/fixtures/hasura/chinook/connector/chinook/.env b/fixtures/hasura/chinook/connector/chinook/.env index 7f6640d6..ee57a147 100644 --- a/fixtures/hasura/chinook/connector/chinook/.env +++ b/fixtures/hasura/chinook/connector/chinook/.env @@ -1,3 +1 @@ -OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://local.hasura.dev:4317 -OTEL_SERVICE_NAME=chinook_chinook MONGODB_DATABASE_URI="mongodb://localhost/chinook" diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/.env b/fixtures/hasura/sample_mflix/connector/sample_mflix/.env index 884073bf..fea5fc4a 100644 --- a/fixtures/hasura/sample_mflix/connector/sample_mflix/.env +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/.env @@ -1,3 +1 @@ -OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://local.hasura.dev:4317 -OTEL_SERVICE_NAME=sample_mflix_sample_mflix MONGODB_DATABASE_URI="mongodb://localhost/sample_mflix" From ff725187a7d454063542a6e900202822ecba76a9 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Wed, 10 Jul 2024 12:10:42 -0700 Subject: [PATCH 32/34] delete more things --- .../.hasura-connector/connector-metadata.yaml | 15 --------------- .../.hasura-connector/connector-metadata.yaml | 15 --------------- 2 files changed, 30 deletions(-) delete mode 100644 fixtures/hasura/chinook/connector/chinook/.hasura-connector/connector-metadata.yaml delete mode 100644 fixtures/hasura/sample_mflix/connector/sample_mflix/.hasura-connector/connector-metadata.yaml diff --git a/fixtures/hasura/chinook/connector/chinook/.hasura-connector/connector-metadata.yaml b/fixtures/hasura/chinook/connector/chinook/.hasura-connector/connector-metadata.yaml deleted file mode 100644 index 1e8bb916..00000000 --- a/fixtures/hasura/chinook/connector/chinook/.hasura-connector/connector-metadata.yaml +++ /dev/null @@ -1,15 +0,0 @@ -packagingDefinition: - type: PrebuiltDockerImage - dockerImage: ghcr.io/hasura/ndc-mongodb:v0.0.6 -supportedEnvironmentVariables: - - name: MONGODB_DATABASE_URI - description: The URI for the MongoDB database -commands: - update: hasura-ndc-mongodb update -cliPlugin: - name: ndc-mongodb - version: v0.0.6 -dockerComposeWatch: - - path: ./ - target: /etc/connector - action: sync+restart diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/.hasura-connector/connector-metadata.yaml b/fixtures/hasura/sample_mflix/connector/sample_mflix/.hasura-connector/connector-metadata.yaml deleted file mode 100644 index 1e8bb916..00000000 --- a/fixtures/hasura/sample_mflix/connector/sample_mflix/.hasura-connector/connector-metadata.yaml +++ /dev/null @@ -1,15 +0,0 @@ -packagingDefinition: - type: PrebuiltDockerImage - dockerImage: ghcr.io/hasura/ndc-mongodb:v0.0.6 -supportedEnvironmentVariables: - - name: MONGODB_DATABASE_URI - description: The URI for the MongoDB database -commands: - update: hasura-ndc-mongodb update -cliPlugin: - name: ndc-mongodb - version: v0.0.6 -dockerComposeWatch: - - path: ./ - target: /etc/connector - action: sync+restart From 4d608ff3a4392640609a6cddd0f6cb4d76c62cfc Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Wed, 10 Jul 2024 12:10:50 -0700 Subject: [PATCH 33/34] update sample_mflix schema with non-nullable settings --- .../connector/sample_mflix/configuration.json | 2 +- .../connector/sample_mflix/schema/movies.json | 54 +++++++++++-------- .../connector/sample_mflix/schema/users.json | 10 ++++ 3 files changed, 44 insertions(+), 22 deletions(-) diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/configuration.json b/fixtures/hasura/sample_mflix/connector/sample_mflix/configuration.json index 71388b75..e2c0aaab 100644 --- a/fixtures/hasura/sample_mflix/connector/sample_mflix/configuration.json +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/configuration.json @@ -2,6 +2,6 @@ "introspectionOptions": { "sampleSize": 100, "noValidatorSchema": false, - "allSchemaNullable": false, + "allSchemaNullable": false } } diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/movies.json b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/movies.json index bb96aee5..96784456 100644 --- a/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/movies.json +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/movies.json @@ -43,7 +43,9 @@ }, "fullplot": { "type": { - "scalar": "string" + "nullable": { + "scalar": "string" + } } }, "genres": { @@ -60,8 +62,10 @@ }, "languages": { "type": { - "arrayOf": { - "scalar": "string" + "nullable": { + "arrayOf": { + "scalar": "string" + } } } }, @@ -86,12 +90,16 @@ }, "plot": { "type": { - "scalar": "string" + "nullable": { + "scalar": "string" + } } }, "poster": { "type": { - "scalar": "string" + "nullable": { + "scalar": "string" + } } }, "rated": { @@ -103,12 +111,16 @@ }, "released": { "type": { - "scalar": "date" + "nullable": { + "scalar": "date" + } } }, "runtime": { "type": { - "scalar": "int" + "nullable": { + "scalar": "int" + } } }, "title": { @@ -118,7 +130,9 @@ }, "tomatoes": { "type": { - "object": "movies_tomatoes" + "nullable": { + "object": "movies_tomatoes" + } } }, "type": { @@ -128,8 +142,10 @@ }, "writers": { "type": { - "arrayOf": { - "scalar": "string" + "nullable": { + "arrayOf": { + "scalar": "string" + } } } }, @@ -252,9 +268,7 @@ "fields": { "meter": { "type": { - "nullable": { - "scalar": "int" - } + "scalar": "int" } }, "numReviews": { @@ -264,9 +278,7 @@ }, "rating": { "type": { - "nullable": { - "scalar": "double" - } + "scalar": "double" } } } @@ -275,7 +287,9 @@ "fields": { "meter": { "type": { - "scalar": "int" + "nullable": { + "scalar": "int" + } } }, "numReviews": { @@ -285,12 +299,10 @@ }, "rating": { "type": { - "nullable": { - "scalar": "double" - } + "scalar": "double" } } } } } -} +} \ No newline at end of file diff --git a/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/users.json b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/users.json index 71e27cec..ec2b7149 100644 --- a/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/users.json +++ b/fixtures/hasura/sample_mflix/connector/sample_mflix/schema/users.json @@ -27,8 +27,18 @@ "type": { "scalar": "string" } + }, + "preferences": { + "type": { + "nullable": { + "object": "users_preferences" + } + } } } + }, + "users_preferences": { + "fields": {} } } } \ No newline at end of file From 5851b451644d39f53b3639a5d54e79cc83f552f7 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Wed, 10 Jul 2024 12:23:36 -0700 Subject: [PATCH 34/34] update sample_mflix metadata again after restarting connector --- fixtures/hasura/README.md | 4 +- .../sample_mflix/metadata/models/Movies.hml | 24 ++--- .../sample_mflix/metadata/models/Users.hml | 40 ++++++++- .../sample_mflix/metadata/sample_mflix.hml | 88 ++++++++++++------- 4 files changed, 107 insertions(+), 49 deletions(-) diff --git a/fixtures/hasura/README.md b/fixtures/hasura/README.md index 8bf6bfbb..4b95bb9b 100644 --- a/fixtures/hasura/README.md +++ b/fixtures/hasura/README.md @@ -24,7 +24,9 @@ $ ddn connector introspect --connector sample_mflix/connector/sample_mflix/conne $ ddn connector introspect --connector chinook/connector/chinook/connector.yaml ``` -Update ddn based on connector configuration: +Update Hasura metadata based on connector configuration +(after restarting connectors with `arion up -d` if there were changes from +introspection): ```sh $ ddn connector-link update sample_mflix --subgraph sample_mflix/subgraph.yaml --env-file sample_mflix/.env.sample_mflix --add-all-resources diff --git a/fixtures/hasura/sample_mflix/metadata/models/Movies.hml b/fixtures/hasura/sample_mflix/metadata/models/Movies.hml index 9eec3082..29ff1c52 100644 --- a/fixtures/hasura/sample_mflix/metadata/models/Movies.hml +++ b/fixtures/hasura/sample_mflix/metadata/models/Movies.hml @@ -69,11 +69,11 @@ definition: name: MoviesTomatoesCritic fields: - name: meter - type: Int + type: Int! - name: numReviews type: Int! - name: rating - type: Double + type: Double! graphql: typeName: MoviesTomatoesCritic inputTypeName: MoviesTomatoesCriticInput @@ -101,11 +101,11 @@ definition: name: MoviesTomatoesViewer fields: - name: meter - type: Int! + type: Int - name: numReviews type: Int! - name: rating - type: Double + type: Double! graphql: typeName: MoviesTomatoesViewer inputTypeName: MoviesTomatoesViewerInput @@ -196,13 +196,13 @@ definition: - name: directors type: "[String!]!" - name: fullplot - type: String! + type: String - name: genres type: "[String!]!" - name: imdb type: MoviesImdb! - name: languages - type: "[String!]!" + type: "[String!]" - name: lastupdated type: String! - name: metacritic @@ -210,23 +210,23 @@ definition: - name: numMflixComments type: Int - name: plot - type: String! + type: String - name: poster - type: String! + type: String - name: rated type: String - name: released - type: Date! + type: Date - name: runtime - type: Int! + type: Int - name: title type: String! - name: tomatoes - type: MoviesTomatoes! + type: MoviesTomatoes - name: type type: String! - name: writers - type: "[String!]!" + type: "[String!]" - name: year type: Int! graphql: diff --git a/fixtures/hasura/sample_mflix/metadata/models/Users.hml b/fixtures/hasura/sample_mflix/metadata/models/Users.hml index 48ba8510..ae9324b7 100644 --- a/fixtures/hasura/sample_mflix/metadata/models/Users.hml +++ b/fixtures/hasura/sample_mflix/metadata/models/Users.hml @@ -12,6 +12,8 @@ definition: type: String! - name: password type: String! + - name: preferences + type: UsersPreferences graphql: typeName: Users inputTypeName: UsersInput @@ -31,6 +33,9 @@ definition: password: column: name: password + preferences: + column: + name: preferences --- kind: TypePermissions @@ -45,6 +50,7 @@ definition: - email - name - password + - preferences - role: user output: allowedFields: @@ -73,6 +79,9 @@ definition: - fieldName: password operators: enableAll: true + - fieldName: preferences + operators: + enableAll: true graphql: typeName: UsersBoolExp @@ -99,6 +108,9 @@ definition: - fieldName: password orderByDirections: enableAll: true + - fieldName: preferences + orderByDirections: + enableAll: true graphql: selectMany: queryRootField: users @@ -119,9 +131,33 @@ definition: filter: null - role: user select: - filter: + filter: fieldComparison: field: id operator: _eq - value: + value: sessionVariable: x-hasura-user-id + +--- +kind: ObjectType +version: v1 +definition: + name: UsersPreferences + fields: [] + graphql: + typeName: SampleMflix_UsersPreferences + inputTypeName: SampleMflix_UsersPreferencesInput + dataConnectorTypeMapping: + - dataConnectorName: sample_mflix + dataConnectorObjectType: users_preferences + +--- +kind: TypePermissions +version: v1 +definition: + typeName: UsersPreferences + permissions: + - role: admin + output: + allowedFields: [] + diff --git a/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml b/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml index e3d3f74b..66d3e245 100644 --- a/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml +++ b/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml @@ -591,8 +591,10 @@ definition: name: String fullplot: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String genres: type: type: array @@ -605,10 +607,12 @@ definition: name: movies_imdb languages: type: - type: array - element_type: - type: named - name: String + type: nullable + underlying_type: + type: array + element_type: + type: named + name: String lastupdated: type: type: named @@ -627,12 +631,16 @@ definition: name: Int plot: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String poster: type: - type: named - name: String + type: nullable + underlying_type: + type: named + name: String rated: type: type: nullable @@ -641,30 +649,38 @@ definition: name: String released: type: - type: named - name: Date + type: nullable + underlying_type: + type: named + name: Date runtime: type: - type: named - name: Int + type: nullable + underlying_type: + type: named + name: Int title: type: type: named name: String tomatoes: type: - type: named - name: movies_tomatoes + type: nullable + underlying_type: + type: named + name: movies_tomatoes type: type: type: named name: String writers: type: - type: array - element_type: - type: named - name: String + type: nullable + underlying_type: + type: array + element_type: + type: named + name: String year: type: type: named @@ -759,36 +775,32 @@ definition: fields: meter: type: - type: nullable - underlying_type: - type: named - name: Int + type: named + name: Int numReviews: type: type: named name: Int rating: type: - type: nullable - underlying_type: - type: named - name: Double + type: named + name: Double movies_tomatoes_viewer: fields: meter: type: - type: named - name: Int + type: nullable + underlying_type: + type: named + name: Int numReviews: type: type: named name: Int rating: type: - type: nullable - underlying_type: - type: named - name: Double + type: named + name: Double sessions: fields: _id: @@ -881,6 +893,14 @@ definition: type: type: named name: String + preferences: + type: + type: nullable + underlying_type: + type: named + name: users_preferences + users_preferences: + fields: {} collections: - name: comments arguments: {}