diff --git a/arion-compose/fixtures-mongodb.nix b/arion-compose/fixtures-mongodb.nix index 47446e23..f76af617 100644 --- a/arion-compose/fixtures-mongodb.nix +++ b/arion-compose/fixtures-mongodb.nix @@ -1,4 +1,5 @@ # MongoDB fixtures in the form of docker volume mounting strings { + all-fixtures = "${toString ./..}/fixtures/mongodb:/docker-entrypoint-initdb.d:ro"; chinook = "${toString ./..}/fixtures/mongodb/chinook:/docker-entrypoint-initdb.d:ro"; } diff --git a/arion-compose/project-connector.nix b/arion-compose/project-connector.nix index 22c7e687..5af31152 100644 --- a/arion-compose/project-connector.nix +++ b/arion-compose/project-connector.nix @@ -6,7 +6,7 @@ { pkgs, ... }: let - connector-port = "7130"; + connector = "7130"; engine-port = "7100"; mongodb-port = "27017"; in @@ -14,13 +14,16 @@ in project.name = "mongodb-connector"; services = { - connector = import ./service-mongodb-connector.nix { + connector = import ./service-connector.nix { inherit pkgs; - port = connector-port; - hostPort = connector-port; + configuration-dir = ../fixtures/connector/sample_mflix; + database-uri = "mongodb://mongodb/sample_mflix"; + port = connector; + hostPort = connector; otlp-endpoint = "http://jaeger:4317"; service.depends_on = { jaeger.condition = "service_healthy"; + mongodb.condition = "service_healthy"; }; }; @@ -30,7 +33,7 @@ in hostPort = mongodb-port; volumes = [ "mongodb:/data/db" - (import ./fixtures-mongodb.nix).chinook + (import ./fixtures-mongodb.nix).all-fixtures ]; }; @@ -38,7 +41,9 @@ in inherit pkgs; port = engine-port; hostPort = engine-port; - connector-url = "http://connector:${connector-port}"; + connectors = [ + { name = "sample_mflix"; url = "http://connector:${connector}"; subgraph = ../fixtures/ddn/subgraphs/sample_mflix; } + ]; otlp-endpoint = "http://jaeger:4317"; service.depends_on = { auth-hook.condition = "service_started"; diff --git a/arion-compose/project-e2e-testing.nix b/arion-compose/project-e2e-testing.nix index e25b1359..e8483684 100644 --- a/arion-compose/project-e2e-testing.nix +++ b/arion-compose/project-e2e-testing.nix @@ -18,8 +18,10 @@ in }; }; - connector = import ./service-mongodb-connector.nix { + connector = import ./service-connector.nix { inherit pkgs; + configuration-dir = ../fixtures/connector/chinook; + database-uri = "mongodb://mongodb/chinook"; port = connector-port; service.depends_on.mongodb.condition = "service_healthy"; }; @@ -35,7 +37,7 @@ in engine = import ./service-engine.nix { inherit pkgs; port = engine-port; - connector-url = "http://connector:${connector-port}"; + connectors = [{ name = "chinook"; url = "http://connector:${connector-port}"; subgraph = ../fixtures/ddn/subgraphs/chinook; }]; service.depends_on = { auth-hook.condition = "service_started"; }; diff --git a/arion-compose/project-ndc-test.nix b/arion-compose/project-ndc-test.nix index 541a0cf0..11721611 100644 --- a/arion-compose/project-ndc-test.nix +++ b/arion-compose/project-ndc-test.nix @@ -7,9 +7,10 @@ in project.name = "mongodb-ndc-test"; services = { - test = import ./service-mongodb-connector.nix { + test = import ./service-connector.nix { inherit pkgs; command = "test"; + configuration-dir = ../fixtures/connector/chinook; database-uri = "mongodb://mongodb:${mongodb-port}/chinook"; service.depends_on.mongodb.condition = "service_healthy"; }; @@ -17,6 +18,9 @@ in mongodb = import ./service-mongodb.nix { inherit pkgs; port = mongodb-port; + volumes = [ + (import ./fixtures-mongodb.nix).chinook + ]; }; }; } diff --git a/arion-compose/service-mongodb-connector.nix b/arion-compose/service-connector.nix similarity index 93% rename from arion-compose/service-mongodb-connector.nix rename to arion-compose/service-connector.nix index 0843ca44..2bd9edf2 100644 --- a/arion-compose/service-mongodb-connector.nix +++ b/arion-compose/service-connector.nix @@ -12,8 +12,8 @@ , profile ? "dev" # Rust crate profile, usually either "dev" or "release" , hostPort ? null , command ? "serve" -, configuration-dir ? ../fixtures/connector/chinook -, database-uri ? "mongodb://mongodb/chinook" +, configuration-dir ? ../fixtures/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/service-engine.nix b/arion-compose/service-engine.nix index e72ed866..f6404d39 100644 --- a/arion-compose/service-engine.nix +++ b/arion-compose/service-engine.nix @@ -1,8 +1,7 @@ { pkgs , port ? "7100" , hostPort ? null -, connector-url ? "http://connector:7130" -, ddn-subgraph-dir ? ../fixtures/ddn/subgraphs/chinook +, connectors ? [{ name = "sample_mflix"; url = "http://connector:7130"; subgraph = ../fixtures/ddn/subgraphs/sample_mflix; }] , auth-webhook ? { url = "http://auth-hook:3050/validate-request"; } , otlp-endpoint ? "http://jaeger:4317" , service ? { } # additional options to customize this service configuration @@ -12,8 +11,8 @@ let # Compile JSON metadata from HML fixture metadata = pkgs.stdenv.mkDerivation { name = "hasura-metadata.json"; - src = ddn-subgraph-dir; - nativeBuildInputs = with pkgs; [ jq yq-go ]; + src = (builtins.head connectors).subgraph; + nativeBuildInputs = with pkgs; [ findutils jq yq-go ]; # The yq command converts the input sequence of yaml docs to a sequence of # newline-separated json docs. @@ -22,13 +21,14 @@ let # switch), and modifies the json to update the data connector url. buildPhase = '' combined=$(mktemp -t subgraph-XXXXXX.hml) - for obj in **/*.hml; do + for obj in $(find . -name '*hml'); do echo "---" >> "$combined" cat "$obj" >> "$combined" done cat "$combined" \ | yq -o=json \ - | jq -s 'map(if .kind == "DataConnectorLink" then .definition.url = { singleUrl: { value: "${connector-url}" } } else . end) | map(select(type != "null"))' \ + ${connector-url-substituters} \ + | jq -s 'map(select(type != "null"))' \ > metadata.json ''; @@ -37,6 +37,14 @@ let ''; }; + # Pipe commands to replace data connector urls in fixture configuration with + # urls of dockerized connector instances + connector-url-substituters = builtins.toString (builtins.map + ({ name, url, ... }: + '' | jq 'if .kind == "DataConnectorLink" and .definition.name == "${name}" then .definition.url = { singleUrl: { value: "${url}" } } else . end' '' + ) + connectors); + auth-config = pkgs.writeText "auth_config.json" (builtins.toJSON { version = "v1"; definition = { diff --git a/fixtures/connector/sample_mflix/schema/comments.json b/fixtures/connector/sample_mflix/schema/comments.json new file mode 100644 index 00000000..bc8d022e --- /dev/null +++ b/fixtures/connector/sample_mflix/schema/comments.json @@ -0,0 +1,44 @@ +{ + "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 new file mode 100644 index 00000000..31237cc7 --- /dev/null +++ b/fixtures/connector/sample_mflix/schema/movies.json @@ -0,0 +1,290 @@ +{ + "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": "extendedJSON" + }, + "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": "extendedJSON" + } + } + } + } +} \ No newline at end of file diff --git a/fixtures/connector/sample_mflix/schema/sessions.json b/fixtures/connector/sample_mflix/schema/sessions.json new file mode 100644 index 00000000..364b9050 --- /dev/null +++ b/fixtures/connector/sample_mflix/schema/sessions.json @@ -0,0 +1,29 @@ +{ + "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 new file mode 100644 index 00000000..df44678b --- /dev/null +++ b/fixtures/connector/sample_mflix/schema/theaters.json @@ -0,0 +1,90 @@ +{ + "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 new file mode 100644 index 00000000..71e27cec --- /dev/null +++ b/fixtures/connector/sample_mflix/schema/users.json @@ -0,0 +1,34 @@ +{ + "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/subgraphs/chinook/commands/InsertArtist.hml b/fixtures/ddn/subgraphs/chinook/commands/InsertArtist.hml index 6a726d4b..115a31bb 100644 --- a/fixtures/ddn/subgraphs/chinook/commands/InsertArtist.hml +++ b/fixtures/ddn/subgraphs/chinook/commands/InsertArtist.hml @@ -10,7 +10,7 @@ definition: - name: name type: String! source: - dataConnectorName: mongodb + dataConnectorName: chinook dataConnectorCommand: procedure: insertArtist argumentMapping: @@ -42,7 +42,7 @@ definition: - name: n type: Int! dataConnectorTypeMapping: - - dataConnectorName: mongodb + - dataConnectorName: chinook dataConnectorObjectType: InsertArtist fieldMapping: ok: { column: { name: ok } } diff --git a/fixtures/ddn/subgraphs/chinook/dataconnectors/mongodb-types.hml b/fixtures/ddn/subgraphs/chinook/dataconnectors/chinook-types.hml similarity index 89% rename from fixtures/ddn/subgraphs/chinook/dataconnectors/mongodb-types.hml rename to fixtures/ddn/subgraphs/chinook/dataconnectors/chinook-types.hml index cb62f8d9..fb4f6592 100644 --- a/fixtures/ddn/subgraphs/chinook/dataconnectors/mongodb-types.hml +++ b/fixtures/ddn/subgraphs/chinook/dataconnectors/chinook-types.hml @@ -10,7 +10,7 @@ definition: kind: DataConnectorScalarRepresentation version: v1 definition: - dataConnectorName: mongodb + dataConnectorName: chinook dataConnectorScalarType: ObjectId representation: ObjectId graphql: @@ -20,7 +20,7 @@ definition: kind: DataConnectorScalarRepresentation version: v1 definition: - dataConnectorName: mongodb + dataConnectorName: chinook dataConnectorScalarType: Int representation: Int graphql: @@ -30,7 +30,7 @@ definition: kind: DataConnectorScalarRepresentation version: v1 definition: - dataConnectorName: mongodb + dataConnectorName: chinook dataConnectorScalarType: String representation: String graphql: @@ -48,7 +48,7 @@ definition: kind: DataConnectorScalarRepresentation version: v1 definition: - dataConnectorName: mongodb + dataConnectorName: chinook dataConnectorScalarType: ExtendedJSON representation: ExtendedJson graphql: @@ -58,7 +58,7 @@ definition: kind: DataConnectorScalarRepresentation version: v1 definition: - dataConnectorName: mongodb + dataConnectorName: chinook dataConnectorScalarType: Float representation: Float graphql: diff --git a/fixtures/ddn/subgraphs/chinook/dataconnectors/mongodb.hml b/fixtures/ddn/subgraphs/chinook/dataconnectors/chinook.hml similarity index 99% rename from fixtures/ddn/subgraphs/chinook/dataconnectors/mongodb.hml rename to fixtures/ddn/subgraphs/chinook/dataconnectors/chinook.hml index af17bf72..40c6b0a3 100644 --- a/fixtures/ddn/subgraphs/chinook/dataconnectors/mongodb.hml +++ b/fixtures/ddn/subgraphs/chinook/dataconnectors/chinook.hml @@ -1,7 +1,7 @@ kind: DataConnectorLink version: v1 definition: - name: mongodb + name: chinook url: singleUrl: value: http://localhost:7130 diff --git a/fixtures/ddn/subgraphs/chinook/models/Album.hml b/fixtures/ddn/subgraphs/chinook/models/Album.hml index 51854f13..f332e8a4 100644 --- a/fixtures/ddn/subgraphs/chinook/models/Album.hml +++ b/fixtures/ddn/subgraphs/chinook/models/Album.hml @@ -16,7 +16,7 @@ definition: typeName: App_Album inputTypeName: App_AlbumInput dataConnectorTypeMapping: - - dataConnectorName: mongodb + - dataConnectorName: chinook dataConnectorObjectType: Album fieldMapping: id: @@ -52,7 +52,7 @@ version: v1 definition: name: AlbumBoolExp objectType: Album - dataConnectorName: mongodb + dataConnectorName: chinook dataConnectorObjectType: Album comparableFields: - fieldName: id @@ -77,7 +77,7 @@ definition: name: Album objectType: Album source: - dataConnectorName: mongodb + dataConnectorName: chinook collection: Album filterExpressionType: AlbumBoolExp orderableFields: diff --git a/fixtures/ddn/subgraphs/chinook/models/Artist.hml b/fixtures/ddn/subgraphs/chinook/models/Artist.hml index a3a8f7b6..971975ea 100644 --- a/fixtures/ddn/subgraphs/chinook/models/Artist.hml +++ b/fixtures/ddn/subgraphs/chinook/models/Artist.hml @@ -14,7 +14,7 @@ definition: typeName: App_Artist inputTypeName: App_ArtistInput dataConnectorTypeMapping: - - dataConnectorName: mongodb + - dataConnectorName: chinook dataConnectorObjectType: Artist fieldMapping: id: @@ -46,7 +46,7 @@ version: v1 definition: name: ArtistBoolExp objectType: Artist - dataConnectorName: mongodb + dataConnectorName: chinook dataConnectorObjectType: Artist comparableFields: - fieldName: id @@ -68,7 +68,7 @@ definition: name: Artist objectType: Artist source: - dataConnectorName: mongodb + dataConnectorName: chinook collection: Artist filterExpressionType: ArtistBoolExp orderableFields: diff --git a/fixtures/ddn/subgraphs/chinook/models/Customer.hml b/fixtures/ddn/subgraphs/chinook/models/Customer.hml index 3de9bc1e..54917793 100644 --- a/fixtures/ddn/subgraphs/chinook/models/Customer.hml +++ b/fixtures/ddn/subgraphs/chinook/models/Customer.hml @@ -36,7 +36,7 @@ definition: typeName: App_Customer inputTypeName: App_CustomerInput dataConnectorTypeMapping: - - dataConnectorName: mongodb + - dataConnectorName: chinook dataConnectorObjectType: Customer fieldMapping: id: @@ -112,7 +112,7 @@ version: v1 definition: name: CustomerBoolExp objectType: Customer - dataConnectorName: mongodb + dataConnectorName: chinook dataConnectorObjectType: Customer comparableFields: - fieldName: id @@ -167,7 +167,7 @@ definition: name: Customer objectType: Customer source: - dataConnectorName: mongodb + dataConnectorName: chinook collection: Customer filterExpressionType: CustomerBoolExp orderableFields: diff --git a/fixtures/ddn/subgraphs/chinook/models/Employee.hml b/fixtures/ddn/subgraphs/chinook/models/Employee.hml index 5610228a..a59f3d73 100644 --- a/fixtures/ddn/subgraphs/chinook/models/Employee.hml +++ b/fixtures/ddn/subgraphs/chinook/models/Employee.hml @@ -40,7 +40,7 @@ definition: typeName: App_Employee inputTypeName: App_EmployeeInput dataConnectorTypeMapping: - - dataConnectorName: mongodb + - dataConnectorName: chinook dataConnectorObjectType: Employee fieldMapping: id: @@ -124,7 +124,7 @@ version: v1 definition: name: EmployeeBoolExp objectType: Employee - dataConnectorName: mongodb + dataConnectorName: chinook dataConnectorObjectType: Employee comparableFields: - fieldName: id @@ -185,7 +185,7 @@ definition: name: Employee objectType: Employee source: - dataConnectorName: mongodb + dataConnectorName: chinook collection: Employee filterExpressionType: EmployeeBoolExp orderableFields: diff --git a/fixtures/ddn/subgraphs/chinook/models/Genre.hml b/fixtures/ddn/subgraphs/chinook/models/Genre.hml index 81deb556..1af381cc 100644 --- a/fixtures/ddn/subgraphs/chinook/models/Genre.hml +++ b/fixtures/ddn/subgraphs/chinook/models/Genre.hml @@ -14,7 +14,7 @@ definition: typeName: App_Genre inputTypeName: App_GenreInput dataConnectorTypeMapping: - - dataConnectorName: mongodb + - dataConnectorName: chinook dataConnectorObjectType: Genre fieldMapping: id: @@ -46,7 +46,7 @@ version: v1 definition: name: GenreBoolExp objectType: Genre - dataConnectorName: mongodb + dataConnectorName: chinook dataConnectorObjectType: Genre comparableFields: - fieldName: id @@ -68,7 +68,7 @@ definition: name: Genre objectType: Genre source: - dataConnectorName: mongodb + dataConnectorName: chinook collection: Genre filterExpressionType: GenreBoolExp orderableFields: diff --git a/fixtures/ddn/subgraphs/chinook/models/Invoice.hml b/fixtures/ddn/subgraphs/chinook/models/Invoice.hml index 38601434..2773af88 100644 --- a/fixtures/ddn/subgraphs/chinook/models/Invoice.hml +++ b/fixtures/ddn/subgraphs/chinook/models/Invoice.hml @@ -28,7 +28,7 @@ definition: typeName: App_Invoice inputTypeName: App_InvoiceInput dataConnectorTypeMapping: - - dataConnectorName: mongodb + - dataConnectorName: chinook dataConnectorObjectType: Invoice fieldMapping: id: @@ -88,7 +88,7 @@ version: v1 definition: name: InvoiceBoolExp objectType: Invoice - dataConnectorName: mongodb + dataConnectorName: chinook dataConnectorObjectType: Invoice comparableFields: - fieldName: id @@ -131,7 +131,7 @@ definition: name: Invoice objectType: Invoice source: - dataConnectorName: mongodb + dataConnectorName: chinook collection: Invoice filterExpressionType: InvoiceBoolExp orderableFields: diff --git a/fixtures/ddn/subgraphs/chinook/models/InvoiceLine.hml b/fixtures/ddn/subgraphs/chinook/models/InvoiceLine.hml index 11cb9aee..f0259b38 100644 --- a/fixtures/ddn/subgraphs/chinook/models/InvoiceLine.hml +++ b/fixtures/ddn/subgraphs/chinook/models/InvoiceLine.hml @@ -20,7 +20,7 @@ definition: typeName: App_InvoiceLine inputTypeName: App_InvoiceLineInput dataConnectorTypeMapping: - - dataConnectorName: mongodb + - dataConnectorName: chinook dataConnectorObjectType: InvoiceLine fieldMapping: id: @@ -64,7 +64,7 @@ version: v1 definition: name: InvoiceLineBoolExp objectType: InvoiceLine - dataConnectorName: mongodb + dataConnectorName: chinook dataConnectorObjectType: InvoiceLine comparableFields: - fieldName: id @@ -95,7 +95,7 @@ definition: name: InvoiceLine objectType: InvoiceLine source: - dataConnectorName: mongodb + dataConnectorName: chinook collection: InvoiceLine filterExpressionType: InvoiceLineBoolExp orderableFields: diff --git a/fixtures/ddn/subgraphs/chinook/models/MediaType.hml b/fixtures/ddn/subgraphs/chinook/models/MediaType.hml index 1748f0f3..fab30969 100644 --- a/fixtures/ddn/subgraphs/chinook/models/MediaType.hml +++ b/fixtures/ddn/subgraphs/chinook/models/MediaType.hml @@ -14,7 +14,7 @@ definition: typeName: App_MediaType inputTypeName: App_MediaTypeInput dataConnectorTypeMapping: - - dataConnectorName: mongodb + - dataConnectorName: chinook dataConnectorObjectType: MediaType fieldMapping: id: @@ -46,7 +46,7 @@ version: v1 definition: name: MediaTypeBoolExp objectType: MediaType - dataConnectorName: mongodb + dataConnectorName: chinook dataConnectorObjectType: MediaType comparableFields: - fieldName: id @@ -68,7 +68,7 @@ definition: name: MediaType objectType: MediaType source: - dataConnectorName: mongodb + dataConnectorName: chinook collection: MediaType filterExpressionType: MediaTypeBoolExp orderableFields: diff --git a/fixtures/ddn/subgraphs/chinook/models/Playlist.hml b/fixtures/ddn/subgraphs/chinook/models/Playlist.hml index 3b90174b..d5ae7143 100644 --- a/fixtures/ddn/subgraphs/chinook/models/Playlist.hml +++ b/fixtures/ddn/subgraphs/chinook/models/Playlist.hml @@ -14,7 +14,7 @@ definition: typeName: App_Playlist inputTypeName: App_PlaylistInput dataConnectorTypeMapping: - - dataConnectorName: mongodb + - dataConnectorName: chinook dataConnectorObjectType: Playlist fieldMapping: id: @@ -46,7 +46,7 @@ version: v1 definition: name: PlaylistBoolExp objectType: Playlist - dataConnectorName: mongodb + dataConnectorName: chinook dataConnectorObjectType: Playlist comparableFields: - fieldName: id @@ -68,7 +68,7 @@ definition: name: Playlist objectType: Playlist source: - dataConnectorName: mongodb + dataConnectorName: chinook collection: Playlist filterExpressionType: PlaylistBoolExp orderableFields: diff --git a/fixtures/ddn/subgraphs/chinook/models/PlaylistTrack.hml b/fixtures/ddn/subgraphs/chinook/models/PlaylistTrack.hml index d0b0eed9..20c16e5e 100644 --- a/fixtures/ddn/subgraphs/chinook/models/PlaylistTrack.hml +++ b/fixtures/ddn/subgraphs/chinook/models/PlaylistTrack.hml @@ -14,7 +14,7 @@ definition: typeName: App_PlaylistTrack inputTypeName: App_PlaylistTrackInput dataConnectorTypeMapping: - - dataConnectorName: mongodb + - dataConnectorName: chinook dataConnectorObjectType: PlaylistTrack fieldMapping: id: @@ -46,7 +46,7 @@ version: v1 definition: name: PlaylistTrackBoolExp objectType: PlaylistTrack - dataConnectorName: mongodb + dataConnectorName: chinook dataConnectorObjectType: PlaylistTrack comparableFields: - fieldName: id @@ -68,7 +68,7 @@ definition: name: PlaylistTrack objectType: PlaylistTrack source: - dataConnectorName: mongodb + dataConnectorName: chinook collection: PlaylistTrack filterExpressionType: PlaylistTrackBoolExp orderableFields: diff --git a/fixtures/ddn/subgraphs/chinook/models/Track.hml b/fixtures/ddn/subgraphs/chinook/models/Track.hml index 69a1881e..1b684e18 100644 --- a/fixtures/ddn/subgraphs/chinook/models/Track.hml +++ b/fixtures/ddn/subgraphs/chinook/models/Track.hml @@ -28,7 +28,7 @@ definition: typeName: App_Track inputTypeName: App_TrackInput dataConnectorTypeMapping: - - dataConnectorName: mongodb + - dataConnectorName: chinook dataConnectorObjectType: Track fieldMapping: id: @@ -88,7 +88,7 @@ version: v1 definition: name: TrackBoolExp objectType: Track - dataConnectorName: mongodb + dataConnectorName: chinook dataConnectorObjectType: Track comparableFields: - fieldName: id @@ -131,7 +131,7 @@ definition: name: Track objectType: Track source: - dataConnectorName: mongodb + dataConnectorName: chinook collection: Track filterExpressionType: TrackBoolExp orderableFields: diff --git a/fixtures/ddn/subgraphs/sample_mflix/dataconnectors/.gitkeep b/fixtures/ddn/subgraphs/sample_mflix/dataconnectors/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/fixtures/ddn/subgraphs/sample_mflix/dataconnectors/sample_mflix-types.hml b/fixtures/ddn/subgraphs/sample_mflix/dataconnectors/sample_mflix-types.hml new file mode 100644 index 00000000..39bb6889 --- /dev/null +++ b/fixtures/ddn/subgraphs/sample_mflix/dataconnectors/sample_mflix-types.hml @@ -0,0 +1,83 @@ +--- +kind: ScalarType +version: v1 +definition: + name: ObjectId + graphql: + typeName: App_ObjectId + +--- +kind: ScalarType +version: v1 +definition: + name: Date + graphql: + typeName: App_Date + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: sample_mflix + dataConnectorScalarType: ObjectId + representation: ObjectId + graphql: + comparisonExpressionTypeName: App_ObjectIdComparisonExp + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: sample_mflix + dataConnectorScalarType: Date + representation: Date + graphql: + comparisonExpressionTypeName: App_DateComparisonExp + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: sample_mflix + dataConnectorScalarType: String + representation: String + graphql: + comparisonExpressionTypeName: App_StringComparisonExp + +--- +kind: ScalarType +version: v1 +definition: + name: ExtendedJson + graphql: + typeName: App_ExtendedJson + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: sample_mflix + dataConnectorScalarType: Int + representation: Int + graphql: + comparisonExpressionTypeName: App_IntComparisonExp + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: sample_mflix + dataConnectorScalarType: ExtendedJSON + representation: ExtendedJson + graphql: + comparisonExpressionTypeName: App_ExtendedJsonComparisonExp + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: sample_mflix + dataConnectorScalarType: Float + representation: Float + graphql: + comparisonExpressionTypeName: App_FloatComparisonExp diff --git a/fixtures/ddn/subgraphs/sample_mflix/dataconnectors/sample_mflix.hml b/fixtures/ddn/subgraphs/sample_mflix/dataconnectors/sample_mflix.hml new file mode 100644 index 00000000..27bd7bfa --- /dev/null +++ b/fixtures/ddn/subgraphs/sample_mflix/dataconnectors/sample_mflix.hml @@ -0,0 +1,904 @@ +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: ExtendedJSON + 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: ExtendedJSON + 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: ExtendedJSON + 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 + 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: {} + functions: [] + procedures: [] + capabilities: + version: 0.1.1 + capabilities: + query: + aggregates: {} + variables: {} + explain: {} + mutation: {} + relationships: {} diff --git a/fixtures/ddn/subgraphs/sample_mflix/models/Comments.hml b/fixtures/ddn/subgraphs/sample_mflix/models/Comments.hml new file mode 100644 index 00000000..0c6964e7 --- /dev/null +++ b/fixtures/ddn/subgraphs/sample_mflix/models/Comments.hml @@ -0,0 +1,138 @@ +--- +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: App_Comments + inputTypeName: App_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 + +--- +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: App_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: App_CommentsOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: Comments + permissions: + - role: admin + select: + filter: null + diff --git a/fixtures/ddn/subgraphs/sample_mflix/models/Movies.hml b/fixtures/ddn/subgraphs/sample_mflix/models/Movies.hml new file mode 100644 index 00000000..9f144777 --- /dev/null +++ b/fixtures/ddn/subgraphs/sample_mflix/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: App_MoviesAwards + inputTypeName: App_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: App_MoviesImdb + inputTypeName: App_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: App_MoviesTomatoesCritic + inputTypeName: App_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: App_MoviesTomatoesViewer + inputTypeName: App_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: App_MoviesTomatoes + inputTypeName: App_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: App_Movies + inputTypeName: App_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: App_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: App_MoviesOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: Movies + permissions: + - role: admin + select: + filter: null + diff --git a/fixtures/ddn/subgraphs/sample_mflix/models/Sessions.hml b/fixtures/ddn/subgraphs/sample_mflix/models/Sessions.hml new file mode 100644 index 00000000..3cc3436c --- /dev/null +++ b/fixtures/ddn/subgraphs/sample_mflix/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: App_Sessions + inputTypeName: App_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: App_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: App_SessionsOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: Sessions + permissions: + - role: admin + select: + filter: null + diff --git a/fixtures/ddn/subgraphs/sample_mflix/models/Theaters.hml b/fixtures/ddn/subgraphs/sample_mflix/models/Theaters.hml new file mode 100644 index 00000000..b294e615 --- /dev/null +++ b/fixtures/ddn/subgraphs/sample_mflix/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: App_TheatersLocationAddress + inputTypeName: App_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: App_TheatersLocationGeo + inputTypeName: App_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: App_TheatersLocation + inputTypeName: App_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: App_Theaters + inputTypeName: App_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: App_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: App_TheatersOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: Theaters + permissions: + - role: admin + select: + filter: null + diff --git a/fixtures/ddn/subgraphs/sample_mflix/models/Users.hml b/fixtures/ddn/subgraphs/sample_mflix/models/Users.hml new file mode 100644 index 00000000..9d0f656b --- /dev/null +++ b/fixtures/ddn/subgraphs/sample_mflix/models/Users.hml @@ -0,0 +1,114 @@ +--- +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: App_Users + inputTypeName: App_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 + +--- +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: App_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: App_UsersOrderBy + +--- +kind: ModelPermissions +version: v1 +definition: + modelName: Users + permissions: + - role: admin + select: + filter: null +