diff --git a/arion-compose/service-dev-auth-webhook.nix b/arion-compose/service-dev-auth-webhook.nix index 312573a8..2e6cdc52 100644 --- a/arion-compose/service-dev-auth-webhook.nix +++ b/arion-compose/service-dev-auth-webhook.nix @@ -1,14 +1,13 @@ { pkgs }: +let + dev-auth-webhook = pkgs.pkgsCross.linux.dev-auth-webhook; +in { service = { useHostStore = true; - # Get node from a Docker image instead of from Nix because cross-compiling - # Node from Darwin to Linux doesn't work. - image = "node:lts-alpine"; command = [ - "node" - "${pkgs.pkgsCross.linux.dev-auth-webhook}/index.js" + "${dev-auth-webhook}/bin/hasura-dev-auth-webhook" ]; }; } diff --git a/arion-compose/service-engine.nix b/arion-compose/service-engine.nix index 4fc29bb5..e72ed866 100644 --- a/arion-compose/service-engine.nix +++ b/arion-compose/service-engine.nix @@ -28,7 +28,7 @@ let done cat "$combined" \ | yq -o=json \ - | jq -s 'map(if .kind == "DataConnectorLink" then .definition.url = { singleUrl: { value: "${connector-url}" } } else . end)' \ + | jq -s 'map(if .kind == "DataConnectorLink" then .definition.url = { singleUrl: { value: "${connector-url}" } } else . end) | map(select(type != "null"))' \ > metadata.json ''; @@ -54,7 +54,7 @@ in image.contents = with pkgs.pkgsCross.linux; [ cacert curl - v3-engine # added to pkgs via an overlay in flake.nix. + graphql-engine # added to pkgs via an overlay in flake.nix. ]; service = withOverrides service { useHostStore = true; diff --git a/fixtures/ddn/subgraphs/chinook/commands/InsertArtist.hml b/fixtures/ddn/subgraphs/chinook/commands/InsertArtist.hml index 54bad1db..6a726d4b 100644 --- a/fixtures/ddn/subgraphs/chinook/commands/InsertArtist.hml +++ b/fixtures/ddn/subgraphs/chinook/commands/InsertArtist.hml @@ -13,11 +13,9 @@ definition: dataConnectorName: mongodb dataConnectorCommand: procedure: insertArtist - typeMapping: - InsertArtist: - fieldMapping: - ok: { column: ok } - n: { column: n } + argumentMapping: + id: id + name: name graphql: rootFieldName: insertArtist rootFieldKind: Mutation @@ -43,6 +41,12 @@ definition: type: Int! - name: n type: Int! + dataConnectorTypeMapping: + - dataConnectorName: mongodb + dataConnectorObjectType: InsertArtist + fieldMapping: + ok: { column: { name: ok } } + n: { column: { name: n } } --- kind: TypePermissions @@ -55,4 +59,3 @@ definition: allowedFields: - ok - n - diff --git a/fixtures/ddn/subgraphs/chinook/dataconnectors/mongodb-types.hml b/fixtures/ddn/subgraphs/chinook/dataconnectors/mongodb-types.hml index 3d7a0032..cb62f8d9 100644 --- a/fixtures/ddn/subgraphs/chinook/dataconnectors/mongodb-types.hml +++ b/fixtures/ddn/subgraphs/chinook/dataconnectors/mongodb-types.hml @@ -1,9 +1,20 @@ +--- kind: ScalarType version: v1 definition: name: ObjectId graphql: - typeName: objectId + typeName: App_ObjectId + +--- +kind: DataConnectorScalarRepresentation +version: v1 +definition: + dataConnectorName: mongodb + dataConnectorScalarType: ObjectId + representation: ObjectId + graphql: + comparisonExpressionTypeName: App_ObjectIdComparisonExp --- kind: DataConnectorScalarRepresentation @@ -13,7 +24,7 @@ definition: dataConnectorScalarType: Int representation: Int graphql: - comparisonExpressionTypeName: MongodbIntComparisonExp + comparisonExpressionTypeName: App_IntComparisonExp --- kind: DataConnectorScalarRepresentation @@ -23,17 +34,25 @@ definition: dataConnectorScalarType: String representation: String graphql: - comparisonExpressionTypeName: MongodbStringComparisonExp + comparisonExpressionTypeName: App_StringComparisonExp + +--- +kind: ScalarType +version: v1 +definition: + name: ExtendedJson + graphql: + typeName: App_ExtendedJson --- kind: DataConnectorScalarRepresentation version: v1 definition: dataConnectorName: mongodb - dataConnectorScalarType: ObjectId - representation: ObjectId + dataConnectorScalarType: ExtendedJSON + representation: ExtendedJson graphql: - comparisonExpressionTypeName: objectIdComparisonExp + comparisonExpressionTypeName: App_ExtendedJsonComparisonExp --- kind: DataConnectorScalarRepresentation @@ -43,4 +62,4 @@ definition: dataConnectorScalarType: Float representation: Float graphql: - comparisonExpressionTypeName: MongodbFloatComparisonExp + comparisonExpressionTypeName: App_FloatComparisonExp diff --git a/fixtures/ddn/subgraphs/chinook/dataconnectors/mongodb.hml b/fixtures/ddn/subgraphs/chinook/dataconnectors/mongodb.hml index ebb9727d..af17bf72 100644 --- a/fixtures/ddn/subgraphs/chinook/dataconnectors/mongodb.hml +++ b/fixtures/ddn/subgraphs/chinook/dataconnectors/mongodb.hml @@ -143,6 +143,9 @@ definition: argument_type: type: named name: Decimal + ExtendedJSON: + aggregate_functions: {} + comparison_operators: {} Float: aggregate_functions: avg: @@ -495,6 +498,10 @@ definition: object_types: Album: fields: + _id: + type: + type: named + name: ObjectId AlbumId: type: type: named @@ -507,56 +514,42 @@ definition: type: type: named name: String - _id: - type: - type: nullable - underlying_type: - type: named - name: ObjectId Artist: fields: + _id: + type: + type: named + name: ObjectId ArtistId: type: type: named name: Int Name: type: - type: nullable - underlying_type: - type: named - name: String - _id: - type: - type: nullable - underlying_type: - type: named - name: ObjectId + type: named + name: String Customer: fields: + _id: + type: + type: named + 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 @@ -567,10 +560,8 @@ definition: name: String Fax: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String FirstName: type: type: named @@ -581,176 +572,132 @@ 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 - _id: - type: - type: nullable - underlying_type: - type: named - name: ObjectId + type: named + name: Int Employee: fields: + _id: + type: + type: named + 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 underlying_type: type: named - name: String + name: ExtendedJSON State: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String Title: type: - type: nullable - underlying_type: - type: named - name: String - _id: - type: - type: nullable - underlying_type: - type: named - name: ObjectId + type: named + name: String Genre: fields: + _id: + type: + type: named + name: ObjectId GenreId: type: type: named name: Int Name: type: - type: nullable - underlying_type: - type: named - name: String - _id: - type: - type: nullable - underlying_type: - type: named - name: ObjectId + type: named + name: String Invoice: fields: + _id: + type: + type: named + 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 @@ -767,14 +714,12 @@ definition: type: type: named name: Float - _id: - type: - type: nullable - underlying_type: - type: named - name: ObjectId InvoiceLine: fields: + _id: + type: + type: named + name: ObjectId InvoiceId: type: type: named @@ -795,50 +740,40 @@ definition: type: type: named name: Float - _id: - type: - type: nullable - underlying_type: - type: named - name: ObjectId MediaType: fields: + _id: + type: + type: named + name: ObjectId MediaTypeId: type: type: named name: Int Name: type: - type: nullable - underlying_type: - type: named - name: String - _id: - type: - type: nullable - underlying_type: - type: named - name: ObjectId + type: named + name: String Playlist: fields: + _id: + type: + type: named + name: ObjectId Name: type: - type: nullable - underlying_type: - type: named - name: String + type: named + name: String PlaylistId: type: type: named name: Int - _id: - type: - type: nullable - underlying_type: - type: named - name: ObjectId PlaylistTrack: fields: + _id: + type: + type: named + name: ObjectId PlaylistId: type: type: named @@ -847,38 +782,28 @@ definition: type: type: named name: Int - _id: - type: - type: nullable - underlying_type: - type: named - name: ObjectId Track: fields: + _id: + type: + type: named + 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 @@ -899,12 +824,6 @@ definition: type: type: named name: Float - _id: - type: - type: nullable - underlying_type: - type: named - name: ObjectId InsertArtist: fields: ok: @@ -916,87 +835,87 @@ definition: arguments: {} type: Album uniqueness_constraints: - primary_key: + Album_id: unique_columns: - _id foreign_keys: {} - - name: Track + - name: Artist arguments: {} - type: Track + type: Artist uniqueness_constraints: - primary_key: + Artist_id: unique_columns: - _id foreign_keys: {} - - name: Playlist + - name: Customer arguments: {} - type: Playlist + type: Customer uniqueness_constraints: - primary_key: + Customer_id: unique_columns: - _id foreign_keys: {} - - name: InvoiceLine + - name: Employee arguments: {} - type: InvoiceLine + type: Employee uniqueness_constraints: - primary_key: + Employee_id: unique_columns: - _id foreign_keys: {} - - name: PlaylistTrack + - name: Genre arguments: {} - type: PlaylistTrack + type: Genre uniqueness_constraints: - primary_key: + Genre_id: unique_columns: - _id foreign_keys: {} - - name: Employee + - name: Invoice arguments: {} - type: Employee + type: Invoice uniqueness_constraints: - primary_key: + Invoice_id: unique_columns: - _id foreign_keys: {} - - name: Customer + - name: InvoiceLine arguments: {} - type: Customer + type: InvoiceLine uniqueness_constraints: - primary_key: + InvoiceLine_id: unique_columns: - _id foreign_keys: {} - - name: Genre + - name: MediaType arguments: {} - type: Genre + type: MediaType uniqueness_constraints: - primary_key: + MediaType_id: unique_columns: - _id foreign_keys: {} - - name: MediaType + - name: Playlist arguments: {} - type: MediaType + type: Playlist uniqueness_constraints: - primary_key: + Playlist_id: unique_columns: - _id foreign_keys: {} - - name: Invoice + - name: PlaylistTrack arguments: {} - type: Invoice + type: PlaylistTrack uniqueness_constraints: - primary_key: + PlaylistTrack_id: unique_columns: - _id foreign_keys: {} - - name: Artist + - name: Track arguments: {} - type: Artist + type: Track uniqueness_constraints: - primary_key: + Track_id: unique_columns: - _id foreign_keys: {} @@ -1008,17 +927,13 @@ definition: arguments: id: { type: { type: named, name: Int } } name: { type: { type: named, name: String } } - command: { insert: Artist, documents: [{ ArtistId: "{{ id }}", Name: "{{ name }}" }] } capabilities: - version: ^0.1.0 + version: 0.1.1 capabilities: query: aggregates: {} variables: {} explain: {} - mutation: - transactional: null - explain: null - relationships: - relation_comparisons: null - order_by_aggregate: null + mutation: {} + relationships: {} + diff --git a/fixtures/ddn/subgraphs/chinook/models/Album.hml b/fixtures/ddn/subgraphs/chinook/models/Album.hml index 6decae6f..51854f13 100644 --- a/fixtures/ddn/subgraphs/chinook/models/Album.hml +++ b/fixtures/ddn/subgraphs/chinook/models/Album.hml @@ -1,19 +1,36 @@ +--- kind: ObjectType version: v1 definition: name: Album - graphql: - typeName: album - inputTypeName: albumInput fields: - - name: AlbumId + - name: id + type: ObjectId! + - name: albumId type: Int! - - name: ArtistId + - name: artistId type: Int! - - name: Title + - name: title type: String! - - name: _id - type: ObjectId + graphql: + typeName: App_Album + inputTypeName: App_AlbumInput + dataConnectorTypeMapping: + - dataConnectorName: mongodb + dataConnectorObjectType: Album + fieldMapping: + id: + column: + name: _id + albumId: + column: + name: AlbumId + artistId: + column: + name: ArtistId + title: + column: + name: Title --- kind: TypePermissions @@ -24,56 +41,66 @@ definition: - role: admin output: allowedFields: - - AlbumId - - ArtistId - - Title - - _id + - id + - albumId + - artistId + - title --- -kind: Model +kind: ObjectBooleanExpressionType version: v1 definition: - name: Album + name: AlbumBoolExp objectType: Album - filterableFields: - - fieldName: AlbumId + dataConnectorName: mongodb + dataConnectorObjectType: Album + comparableFields: + - fieldName: id operators: enableAll: true - - fieldName: ArtistId + - fieldName: albumId operators: enableAll: true - - fieldName: Title + - fieldName: artistId operators: enableAll: true - - fieldName: _id + - fieldName: title operators: enableAll: true + graphql: + typeName: App_AlbumBoolExp + +--- +kind: Model +version: v1 +definition: + name: Album + objectType: Album + source: + dataConnectorName: mongodb + collection: Album + filterExpressionType: AlbumBoolExp orderableFields: - - fieldName: AlbumId + - fieldName: id orderByDirections: enableAll: true - - fieldName: ArtistId + - fieldName: albumId orderByDirections: enableAll: true - - fieldName: Title + - fieldName: artistId orderByDirections: enableAll: true - - fieldName: _id + - fieldName: title orderByDirections: enableAll: true - arguments: [] graphql: + selectMany: + queryRootField: album selectUniques: - queryRootField: albumById uniqueIdentifier: - - AlbumId - selectMany: - queryRootField: album - filterExpressionType: albumBoolExp - orderByExpressionType: albumOrderBy - source: - collection: Album - dataConnectorName: mongodb + - id + orderByExpressionType: App_AlbumOrderBy --- kind: ModelPermissions @@ -84,3 +111,4 @@ definition: - role: admin select: filter: null + diff --git a/fixtures/ddn/subgraphs/chinook/models/Artist.hml b/fixtures/ddn/subgraphs/chinook/models/Artist.hml index 965f39fc..a3a8f7b6 100644 --- a/fixtures/ddn/subgraphs/chinook/models/Artist.hml +++ b/fixtures/ddn/subgraphs/chinook/models/Artist.hml @@ -1,17 +1,31 @@ +--- kind: ObjectType version: v1 definition: name: Artist - graphql: - typeName: artist - inputTypeName: artistInput fields: - - name: ArtistId + - name: id + type: ObjectId! + - name: artistId type: Int! - - name: Name - type: String - - name: _id - type: ObjectId + - name: name + type: String! + graphql: + typeName: App_Artist + inputTypeName: App_ArtistInput + dataConnectorTypeMapping: + - dataConnectorName: mongodb + dataConnectorObjectType: Artist + fieldMapping: + id: + column: + name: _id + artistId: + column: + name: ArtistId + name: + column: + name: Name --- kind: TypePermissions @@ -22,49 +36,59 @@ definition: - role: admin output: allowedFields: - - ArtistId - - Name - - _id + - id + - artistId + - name --- -kind: Model +kind: ObjectBooleanExpressionType version: v1 definition: - name: Artist + name: ArtistBoolExp objectType: Artist - filterableFields: - - fieldName: ArtistId + dataConnectorName: mongodb + dataConnectorObjectType: Artist + comparableFields: + - fieldName: id operators: enableAll: true - - fieldName: Name + - fieldName: artistId operators: enableAll: true - - fieldName: _id + - fieldName: name operators: enableAll: true + graphql: + typeName: App_ArtistBoolExp + +--- +kind: Model +version: v1 +definition: + name: Artist + objectType: Artist + source: + dataConnectorName: mongodb + collection: Artist + filterExpressionType: ArtistBoolExp orderableFields: - - fieldName: ArtistId + - fieldName: id orderByDirections: enableAll: true - - fieldName: Name + - fieldName: artistId orderByDirections: enableAll: true - - fieldName: _id + - fieldName: name orderByDirections: enableAll: true - arguments: [] graphql: + selectMany: + queryRootField: artist selectUniques: - queryRootField: artistById uniqueIdentifier: - - _id - selectMany: - queryRootField: artist - filterExpressionType: artistBoolExp - orderByExpressionType: artistOrderBy - source: - collection: Artist - dataConnectorName: mongodb + - id + orderByExpressionType: App_ArtistOrderBy --- kind: ModelPermissions @@ -75,3 +99,4 @@ definition: - role: admin select: filter: null + diff --git a/fixtures/ddn/subgraphs/chinook/models/Customer.hml b/fixtures/ddn/subgraphs/chinook/models/Customer.hml index ae48b499..3de9bc1e 100644 --- a/fixtures/ddn/subgraphs/chinook/models/Customer.hml +++ b/fixtures/ddn/subgraphs/chinook/models/Customer.hml @@ -1,39 +1,86 @@ +--- kind: ObjectType version: v1 definition: name: Customer - graphql: - typeName: customer - inputTypeName: customerInput fields: - - name: Address - type: String - - name: City - type: String - - name: Company - type: String - - name: Country - type: String - - name: CustomerId + - name: id + type: ObjectId! + - name: address + type: String! + - name: city + type: String! + - name: company + type: String! + - name: country + type: String! + - name: customerId type: Int! - - name: Email + - name: email + type: String! + - name: fax + type: String! + - name: firstName type: String! - - name: Fax - type: String - - name: FirstName + - name: lastName type: String! - - name: LastName + - name: phone type: String! - - name: Phone - type: String - - name: PostalCode - type: String - - name: State - type: String - - name: SupportRepId - type: Int - - name: _id - type: ObjectId + - name: postalCode + type: ExtendedJson + - name: state + type: String! + - name: supportRepId + type: Int! + graphql: + typeName: App_Customer + inputTypeName: App_CustomerInput + dataConnectorTypeMapping: + - dataConnectorName: mongodb + 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 @@ -44,126 +91,136 @@ definition: - role: admin output: allowedFields: - - Address - - City - - Company - - Country - - CustomerId - - Email - - Fax - - FirstName - - LastName - - Phone - - PostalCode - - State - - SupportRepId - - _id + - id + - address + - city + - company + - country + - customerId + - email + - fax + - firstName + - lastName + - phone + - postalCode + - state + - supportRepId --- -kind: Model +kind: ObjectBooleanExpressionType version: v1 definition: - name: Customer + name: CustomerBoolExp objectType: Customer - filterableFields: - - fieldName: Address + dataConnectorName: mongodb + dataConnectorObjectType: Customer + comparableFields: + - fieldName: id operators: enableAll: true - - fieldName: City + - fieldName: address operators: enableAll: true - - fieldName: Company + - fieldName: city operators: enableAll: true - - fieldName: Country + - fieldName: company operators: enableAll: true - - fieldName: CustomerId + - fieldName: country operators: enableAll: true - - fieldName: Email + - fieldName: customerId operators: enableAll: true - - fieldName: Fax + - fieldName: email operators: enableAll: true - - fieldName: FirstName + - fieldName: fax operators: enableAll: true - - fieldName: LastName + - fieldName: firstName operators: enableAll: true - - fieldName: Phone + - fieldName: lastName operators: enableAll: true - - fieldName: PostalCode + - fieldName: phone operators: enableAll: true - - fieldName: State + - fieldName: postalCode operators: enableAll: true - - fieldName: SupportRepId + - fieldName: state operators: enableAll: true - - fieldName: _id + - fieldName: supportRepId operators: enableAll: true + graphql: + typeName: App_CustomerBoolExp + +--- +kind: Model +version: v1 +definition: + name: Customer + objectType: Customer + source: + dataConnectorName: mongodb + collection: Customer + filterExpressionType: CustomerBoolExp orderableFields: - - fieldName: Address + - fieldName: id orderByDirections: enableAll: true - - fieldName: City + - fieldName: address orderByDirections: enableAll: true - - fieldName: Company + - fieldName: city orderByDirections: enableAll: true - - fieldName: Country + - fieldName: company orderByDirections: enableAll: true - - fieldName: CustomerId + - fieldName: country orderByDirections: enableAll: true - - fieldName: Email + - fieldName: customerId orderByDirections: enableAll: true - - fieldName: Fax + - fieldName: email orderByDirections: enableAll: true - - fieldName: FirstName + - fieldName: fax orderByDirections: enableAll: true - - fieldName: LastName + - fieldName: firstName orderByDirections: enableAll: true - - fieldName: Phone + - fieldName: lastName orderByDirections: enableAll: true - - fieldName: PostalCode + - fieldName: phone orderByDirections: enableAll: true - - fieldName: State + - fieldName: postalCode orderByDirections: enableAll: true - - fieldName: SupportRepId + - fieldName: state orderByDirections: enableAll: true - - fieldName: _id + - fieldName: supportRepId orderByDirections: enableAll: true - arguments: [] graphql: + selectMany: + queryRootField: customer selectUniques: - queryRootField: customerById uniqueIdentifier: - - _id - selectMany: - queryRootField: customer - filterExpressionType: customerBoolExp - orderByExpressionType: customerOrderBy - source: - collection: Customer - dataConnectorName: mongodb + - id + orderByExpressionType: App_CustomerOrderBy --- kind: ModelPermissions @@ -174,3 +231,4 @@ definition: - role: admin select: filter: null + diff --git a/fixtures/ddn/subgraphs/chinook/models/Employee.hml b/fixtures/ddn/subgraphs/chinook/models/Employee.hml index 339eaa2f..5610228a 100644 --- a/fixtures/ddn/subgraphs/chinook/models/Employee.hml +++ b/fixtures/ddn/subgraphs/chinook/models/Employee.hml @@ -1,43 +1,96 @@ +--- kind: ObjectType version: v1 definition: name: Employee - graphql: - typeName: employee - inputTypeName: employeeInput fields: - - name: Address - type: String - - name: BirthDate - type: String - - name: City - type: String - - name: Country - type: String - - name: Email - type: String - - name: EmployeeId + - name: id + type: 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 + - name: fax + type: String! + - name: firstName + type: String! + - name: hireDate type: String! - - name: HireDate - type: String - - name: LastName + - name: lastName type: String! - - name: Phone - type: String - - name: PostalCode - type: String - - name: ReportsTo - type: String - - name: State - type: String - - name: Title - type: String - - name: _id - type: ObjectId + - name: phone + type: String! + - name: postalCode + type: String! + - name: reportsTo + type: ExtendedJson + - name: state + type: String! + - name: title + type: String! + graphql: + typeName: App_Employee + inputTypeName: App_EmployeeInput + dataConnectorTypeMapping: + - dataConnectorName: mongodb + 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 @@ -48,140 +101,150 @@ definition: - role: admin output: allowedFields: - - Address - - BirthDate - - City - - Country - - Email - - EmployeeId - - Fax - - FirstName - - HireDate - - LastName - - Phone - - PostalCode - - ReportsTo - - State - - Title - - _id + - id + - address + - birthDate + - city + - country + - email + - employeeId + - fax + - firstName + - hireDate + - lastName + - phone + - postalCode + - reportsTo + - state + - title --- -kind: Model +kind: ObjectBooleanExpressionType version: v1 definition: - name: Employee + name: EmployeeBoolExp objectType: Employee - filterableFields: - - fieldName: Address + dataConnectorName: mongodb + dataConnectorObjectType: Employee + comparableFields: + - fieldName: id operators: enableAll: true - - fieldName: BirthDate + - fieldName: address operators: enableAll: true - - fieldName: City + - fieldName: birthDate operators: enableAll: true - - fieldName: Country + - fieldName: city operators: enableAll: true - - fieldName: Email + - fieldName: country operators: enableAll: true - - fieldName: EmployeeId + - fieldName: email operators: enableAll: true - - fieldName: Fax + - fieldName: employeeId operators: enableAll: true - - fieldName: FirstName + - fieldName: fax operators: enableAll: true - - fieldName: HireDate + - fieldName: firstName operators: enableAll: true - - fieldName: LastName + - fieldName: hireDate operators: enableAll: true - - fieldName: Phone + - fieldName: lastName operators: enableAll: true - - fieldName: PostalCode + - fieldName: phone operators: enableAll: true - - fieldName: ReportsTo + - fieldName: postalCode operators: enableAll: true - - fieldName: State + - fieldName: reportsTo operators: enableAll: true - - fieldName: Title + - fieldName: state operators: enableAll: true - - fieldName: _id + - fieldName: title operators: enableAll: true + graphql: + typeName: App_EmployeeBoolExp + +--- +kind: Model +version: v1 +definition: + name: Employee + objectType: Employee + source: + dataConnectorName: mongodb + collection: Employee + filterExpressionType: EmployeeBoolExp orderableFields: - - fieldName: Address + - fieldName: id orderByDirections: enableAll: true - - fieldName: BirthDate + - fieldName: address orderByDirections: enableAll: true - - fieldName: City + - fieldName: birthDate orderByDirections: enableAll: true - - fieldName: Country + - fieldName: city orderByDirections: enableAll: true - - fieldName: Email + - fieldName: country orderByDirections: enableAll: true - - fieldName: EmployeeId + - fieldName: email orderByDirections: enableAll: true - - fieldName: Fax + - fieldName: employeeId orderByDirections: enableAll: true - - fieldName: FirstName + - fieldName: fax orderByDirections: enableAll: true - - fieldName: HireDate + - fieldName: firstName orderByDirections: enableAll: true - - fieldName: LastName + - fieldName: hireDate orderByDirections: enableAll: true - - fieldName: Phone + - fieldName: lastName orderByDirections: enableAll: true - - fieldName: PostalCode + - fieldName: phone orderByDirections: enableAll: true - - fieldName: ReportsTo + - fieldName: postalCode orderByDirections: enableAll: true - - fieldName: State + - fieldName: reportsTo orderByDirections: enableAll: true - - fieldName: Title + - fieldName: state orderByDirections: enableAll: true - - fieldName: _id + - fieldName: title orderByDirections: enableAll: true - arguments: [] graphql: + selectMany: + queryRootField: employee selectUniques: - queryRootField: employeeById uniqueIdentifier: - - _id - selectMany: - queryRootField: employee - filterExpressionType: employeeBoolExp - orderByExpressionType: employeeOrderBy - source: - collection: Employee - dataConnectorName: mongodb + - id + orderByExpressionType: App_EmployeeOrderBy --- kind: ModelPermissions @@ -192,3 +255,4 @@ definition: - role: admin select: filter: null + diff --git a/fixtures/ddn/subgraphs/chinook/models/Genre.hml b/fixtures/ddn/subgraphs/chinook/models/Genre.hml index 6ade3f2d..81deb556 100644 --- a/fixtures/ddn/subgraphs/chinook/models/Genre.hml +++ b/fixtures/ddn/subgraphs/chinook/models/Genre.hml @@ -1,17 +1,31 @@ +--- kind: ObjectType version: v1 definition: name: Genre - graphql: - typeName: genre - inputTypeName: genreInput fields: - - name: GenreId + - name: id + type: ObjectId! + - name: genreId type: Int! - - name: Name - type: String - - name: _id - type: ObjectId + - name: name + type: String! + graphql: + typeName: App_Genre + inputTypeName: App_GenreInput + dataConnectorTypeMapping: + - dataConnectorName: mongodb + dataConnectorObjectType: Genre + fieldMapping: + id: + column: + name: _id + genreId: + column: + name: GenreId + name: + column: + name: Name --- kind: TypePermissions @@ -22,49 +36,59 @@ definition: - role: admin output: allowedFields: - - GenreId - - Name - - _id + - id + - genreId + - name --- -kind: Model +kind: ObjectBooleanExpressionType version: v1 definition: - name: Genre + name: GenreBoolExp objectType: Genre - filterableFields: - - fieldName: GenreId + dataConnectorName: mongodb + dataConnectorObjectType: Genre + comparableFields: + - fieldName: id operators: enableAll: true - - fieldName: Name + - fieldName: genreId operators: enableAll: true - - fieldName: _id + - fieldName: name operators: enableAll: true + graphql: + typeName: App_GenreBoolExp + +--- +kind: Model +version: v1 +definition: + name: Genre + objectType: Genre + source: + dataConnectorName: mongodb + collection: Genre + filterExpressionType: GenreBoolExp orderableFields: - - fieldName: GenreId + - fieldName: id orderByDirections: enableAll: true - - fieldName: Name + - fieldName: genreId orderByDirections: enableAll: true - - fieldName: _id + - fieldName: name orderByDirections: enableAll: true - arguments: [] graphql: + selectMany: + queryRootField: genre selectUniques: - queryRootField: genreById uniqueIdentifier: - - _id - selectMany: - queryRootField: genre - filterExpressionType: genreBoolExp - orderByExpressionType: genreOrderBy - source: - collection: Genre - dataConnectorName: mongodb + - id + orderByExpressionType: App_GenreOrderBy --- kind: ModelPermissions @@ -75,3 +99,4 @@ definition: - role: admin select: filter: null + diff --git a/fixtures/ddn/subgraphs/chinook/models/Invoice.hml b/fixtures/ddn/subgraphs/chinook/models/Invoice.hml index 98016bf8..38601434 100644 --- a/fixtures/ddn/subgraphs/chinook/models/Invoice.hml +++ b/fixtures/ddn/subgraphs/chinook/models/Invoice.hml @@ -1,31 +1,66 @@ +--- kind: ObjectType version: v1 definition: name: Invoice - graphql: - typeName: invoice - inputTypeName: invoiceInput fields: - - name: BillingAddress - type: String - - name: BillingCity - type: String - - name: BillingCountry - type: String - - name: BillingPostalCode - type: String - - name: BillingState - type: String - - name: CustomerId + - name: id + type: ObjectId! + - name: billingAddress + type: String! + - name: billingCity + type: String! + - name: billingCountry + type: String! + - name: billingPostalCode + type: ExtendedJson + - name: billingState + type: String! + - name: customerId type: Int! - - name: InvoiceDate + - name: invoiceDate type: String! - - name: InvoiceId + - name: invoiceId type: Int! - - name: Total + - name: total type: Float! - - name: _id - type: ObjectId + graphql: + typeName: App_Invoice + inputTypeName: App_InvoiceInput + dataConnectorTypeMapping: + - dataConnectorName: mongodb + 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 @@ -36,98 +71,108 @@ definition: - role: admin output: allowedFields: - - BillingAddress - - BillingCity - - BillingCountry - - BillingPostalCode - - BillingState - - CustomerId - - InvoiceDate - - InvoiceId - - Total - - _id + - id + - billingAddress + - billingCity + - billingCountry + - billingPostalCode + - billingState + - customerId + - invoiceDate + - invoiceId + - total --- -kind: Model +kind: ObjectBooleanExpressionType version: v1 definition: - name: Invoice + name: InvoiceBoolExp objectType: Invoice - filterableFields: - - fieldName: BillingAddress + dataConnectorName: mongodb + dataConnectorObjectType: Invoice + comparableFields: + - fieldName: id operators: enableAll: true - - fieldName: BillingCity + - fieldName: billingAddress operators: enableAll: true - - fieldName: BillingCountry + - fieldName: billingCity operators: enableAll: true - - fieldName: BillingPostalCode + - fieldName: billingCountry operators: enableAll: true - - fieldName: BillingState + - fieldName: billingPostalCode operators: enableAll: true - - fieldName: CustomerId + - fieldName: billingState operators: enableAll: true - - fieldName: InvoiceDate + - fieldName: customerId operators: enableAll: true - - fieldName: InvoiceId + - fieldName: invoiceDate operators: enableAll: true - - fieldName: Total + - fieldName: invoiceId operators: enableAll: true - - fieldName: _id + - fieldName: total operators: enableAll: true + graphql: + typeName: App_InvoiceBoolExp + +--- +kind: Model +version: v1 +definition: + name: Invoice + objectType: Invoice + source: + dataConnectorName: mongodb + collection: Invoice + filterExpressionType: InvoiceBoolExp orderableFields: - - fieldName: BillingAddress + - fieldName: id orderByDirections: enableAll: true - - fieldName: BillingCity + - fieldName: billingAddress orderByDirections: enableAll: true - - fieldName: BillingCountry + - fieldName: billingCity orderByDirections: enableAll: true - - fieldName: BillingPostalCode + - fieldName: billingCountry orderByDirections: enableAll: true - - fieldName: BillingState + - fieldName: billingPostalCode orderByDirections: enableAll: true - - fieldName: CustomerId + - fieldName: billingState orderByDirections: enableAll: true - - fieldName: InvoiceDate + - fieldName: customerId orderByDirections: enableAll: true - - fieldName: InvoiceId + - fieldName: invoiceDate orderByDirections: enableAll: true - - fieldName: Total + - fieldName: invoiceId orderByDirections: enableAll: true - - fieldName: _id + - fieldName: total orderByDirections: enableAll: true - arguments: [] graphql: + selectMany: + queryRootField: invoice selectUniques: - queryRootField: invoiceById uniqueIdentifier: - - _id - selectMany: - queryRootField: invoice - filterExpressionType: invoiceBoolExp - orderByExpressionType: invoiceOrderBy - source: - collection: Invoice - dataConnectorName: mongodb + - id + orderByExpressionType: App_InvoiceOrderBy --- kind: ModelPermissions @@ -138,3 +183,4 @@ definition: - role: admin select: filter: null + diff --git a/fixtures/ddn/subgraphs/chinook/models/InvoiceLine.hml b/fixtures/ddn/subgraphs/chinook/models/InvoiceLine.hml index 0913c99b..11cb9aee 100644 --- a/fixtures/ddn/subgraphs/chinook/models/InvoiceLine.hml +++ b/fixtures/ddn/subgraphs/chinook/models/InvoiceLine.hml @@ -1,23 +1,46 @@ +--- kind: ObjectType version: v1 definition: name: InvoiceLine - graphql: - typeName: invoiceLine - inputTypeName: invoiceLineInput fields: - - name: InvoiceId + - name: id + type: ObjectId! + - name: invoiceId type: Int! - - name: InvoiceLineId + - name: invoiceLineId type: Int! - - name: Quantity + - name: quantity type: Int! - - name: TrackId + - name: trackId type: Int! - - name: UnitPrice + - name: unitPrice type: Float! - - name: _id - type: ObjectId + graphql: + typeName: App_InvoiceLine + inputTypeName: App_InvoiceLineInput + dataConnectorTypeMapping: + - dataConnectorName: mongodb + 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 @@ -28,70 +51,80 @@ definition: - role: admin output: allowedFields: - - InvoiceId - - InvoiceLineId - - Quantity - - TrackId - - UnitPrice - - _id + - id + - invoiceId + - invoiceLineId + - quantity + - trackId + - unitPrice --- -kind: Model +kind: ObjectBooleanExpressionType version: v1 definition: - name: InvoiceLine + name: InvoiceLineBoolExp objectType: InvoiceLine - filterableFields: - - fieldName: InvoiceId + dataConnectorName: mongodb + dataConnectorObjectType: InvoiceLine + comparableFields: + - fieldName: id operators: enableAll: true - - fieldName: InvoiceLineId + - fieldName: invoiceId operators: enableAll: true - - fieldName: Quantity + - fieldName: invoiceLineId operators: enableAll: true - - fieldName: TrackId + - fieldName: quantity operators: enableAll: true - - fieldName: UnitPrice + - fieldName: trackId operators: enableAll: true - - fieldName: _id + - fieldName: unitPrice operators: enableAll: true + graphql: + typeName: App_InvoiceLineBoolExp + +--- +kind: Model +version: v1 +definition: + name: InvoiceLine + objectType: InvoiceLine + source: + dataConnectorName: mongodb + collection: InvoiceLine + filterExpressionType: InvoiceLineBoolExp orderableFields: - - fieldName: InvoiceId + - fieldName: id orderByDirections: enableAll: true - - fieldName: InvoiceLineId + - fieldName: invoiceId orderByDirections: enableAll: true - - fieldName: Quantity + - fieldName: invoiceLineId orderByDirections: enableAll: true - - fieldName: TrackId + - fieldName: quantity orderByDirections: enableAll: true - - fieldName: UnitPrice + - fieldName: trackId orderByDirections: enableAll: true - - fieldName: _id + - fieldName: unitPrice orderByDirections: enableAll: true - arguments: [] graphql: + selectMany: + queryRootField: invoiceLine selectUniques: - queryRootField: invoiceLineById uniqueIdentifier: - - _id - selectMany: - queryRootField: invoiceLine - filterExpressionType: invoiceLineBoolExp - orderByExpressionType: invoiceLineOrderBy - source: - collection: InvoiceLine - dataConnectorName: mongodb + - id + orderByExpressionType: App_InvoiceLineOrderBy --- kind: ModelPermissions @@ -102,3 +135,4 @@ definition: - role: admin select: filter: null + diff --git a/fixtures/ddn/subgraphs/chinook/models/MediaType.hml b/fixtures/ddn/subgraphs/chinook/models/MediaType.hml index d19eefc1..1748f0f3 100644 --- a/fixtures/ddn/subgraphs/chinook/models/MediaType.hml +++ b/fixtures/ddn/subgraphs/chinook/models/MediaType.hml @@ -1,17 +1,31 @@ +--- kind: ObjectType version: v1 definition: name: MediaType - graphql: - typeName: mediaType - inputTypeName: mediaTypeInput fields: - - name: MediaTypeId + - name: id + type: ObjectId! + - name: mediaTypeId type: Int! - - name: Name - type: String - - name: _id - type: ObjectId + - name: name + type: String! + graphql: + typeName: App_MediaType + inputTypeName: App_MediaTypeInput + dataConnectorTypeMapping: + - dataConnectorName: mongodb + dataConnectorObjectType: MediaType + fieldMapping: + id: + column: + name: _id + mediaTypeId: + column: + name: MediaTypeId + name: + column: + name: Name --- kind: TypePermissions @@ -22,49 +36,59 @@ definition: - role: admin output: allowedFields: - - MediaTypeId - - Name - - _id + - id + - mediaTypeId + - name --- -kind: Model +kind: ObjectBooleanExpressionType version: v1 definition: - name: MediaType + name: MediaTypeBoolExp objectType: MediaType - filterableFields: - - fieldName: MediaTypeId + dataConnectorName: mongodb + dataConnectorObjectType: MediaType + comparableFields: + - fieldName: id operators: enableAll: true - - fieldName: Name + - fieldName: mediaTypeId operators: enableAll: true - - fieldName: _id + - fieldName: name operators: enableAll: true + graphql: + typeName: App_MediaTypeBoolExp + +--- +kind: Model +version: v1 +definition: + name: MediaType + objectType: MediaType + source: + dataConnectorName: mongodb + collection: MediaType + filterExpressionType: MediaTypeBoolExp orderableFields: - - fieldName: MediaTypeId + - fieldName: id orderByDirections: enableAll: true - - fieldName: Name + - fieldName: mediaTypeId orderByDirections: enableAll: true - - fieldName: _id + - fieldName: name orderByDirections: enableAll: true - arguments: [] graphql: + selectMany: + queryRootField: mediaType selectUniques: - queryRootField: mediaTypeById uniqueIdentifier: - - _id - selectMany: - queryRootField: mediaType - filterExpressionType: mediaTypeBoolExp - orderByExpressionType: mediaTypeOrderBy - source: - collection: MediaType - dataConnectorName: mongodb + - id + orderByExpressionType: App_MediaTypeOrderBy --- kind: ModelPermissions @@ -75,3 +99,4 @@ definition: - role: admin select: filter: null + diff --git a/fixtures/ddn/subgraphs/chinook/models/Playlist.hml b/fixtures/ddn/subgraphs/chinook/models/Playlist.hml index ed835d24..3b90174b 100644 --- a/fixtures/ddn/subgraphs/chinook/models/Playlist.hml +++ b/fixtures/ddn/subgraphs/chinook/models/Playlist.hml @@ -1,17 +1,31 @@ +--- kind: ObjectType version: v1 definition: name: Playlist - graphql: - typeName: playlist - inputTypeName: playlistInput fields: - - name: Name - type: String - - name: PlaylistId + - name: id + type: ObjectId! + - name: name + type: String! + - name: playlistId type: Int! - - name: _id - type: ObjectId + graphql: + typeName: App_Playlist + inputTypeName: App_PlaylistInput + dataConnectorTypeMapping: + - dataConnectorName: mongodb + dataConnectorObjectType: Playlist + fieldMapping: + id: + column: + name: _id + name: + column: + name: Name + playlistId: + column: + name: PlaylistId --- kind: TypePermissions @@ -22,49 +36,59 @@ definition: - role: admin output: allowedFields: - - Name - - PlaylistId - - _id + - id + - name + - playlistId --- -kind: Model +kind: ObjectBooleanExpressionType version: v1 definition: - name: Playlist + name: PlaylistBoolExp objectType: Playlist - filterableFields: - - fieldName: Name + dataConnectorName: mongodb + dataConnectorObjectType: Playlist + comparableFields: + - fieldName: id operators: enableAll: true - - fieldName: PlaylistId + - fieldName: name operators: enableAll: true - - fieldName: _id + - fieldName: playlistId operators: enableAll: true + graphql: + typeName: App_PlaylistBoolExp + +--- +kind: Model +version: v1 +definition: + name: Playlist + objectType: Playlist + source: + dataConnectorName: mongodb + collection: Playlist + filterExpressionType: PlaylistBoolExp orderableFields: - - fieldName: Name + - fieldName: id orderByDirections: enableAll: true - - fieldName: PlaylistId + - fieldName: name orderByDirections: enableAll: true - - fieldName: _id + - fieldName: playlistId orderByDirections: enableAll: true - arguments: [] graphql: + selectMany: + queryRootField: playlist selectUniques: - queryRootField: playlistById uniqueIdentifier: - - _id - selectMany: - queryRootField: playlist - filterExpressionType: playlistBoolExp - orderByExpressionType: playlistOrderBy - source: - collection: Playlist - dataConnectorName: mongodb + - id + orderByExpressionType: App_PlaylistOrderBy --- kind: ModelPermissions @@ -75,3 +99,4 @@ definition: - role: admin select: filter: null + diff --git a/fixtures/ddn/subgraphs/chinook/models/PlaylistTrack.hml b/fixtures/ddn/subgraphs/chinook/models/PlaylistTrack.hml index 98528ff2..d0b0eed9 100644 --- a/fixtures/ddn/subgraphs/chinook/models/PlaylistTrack.hml +++ b/fixtures/ddn/subgraphs/chinook/models/PlaylistTrack.hml @@ -1,17 +1,31 @@ +--- kind: ObjectType version: v1 definition: name: PlaylistTrack - graphql: - typeName: playlistTrack - inputTypeName: playlistTrackInput fields: - - name: PlaylistId + - name: id + type: ObjectId! + - name: playlistId type: Int! - - name: TrackId + - name: trackId type: Int! - - name: _id - type: ObjectId + graphql: + typeName: App_PlaylistTrack + inputTypeName: App_PlaylistTrackInput + dataConnectorTypeMapping: + - dataConnectorName: mongodb + dataConnectorObjectType: PlaylistTrack + fieldMapping: + id: + column: + name: _id + playlistId: + column: + name: PlaylistId + trackId: + column: + name: TrackId --- kind: TypePermissions @@ -22,49 +36,59 @@ definition: - role: admin output: allowedFields: - - PlaylistId - - TrackId - - _id + - id + - playlistId + - trackId --- -kind: Model +kind: ObjectBooleanExpressionType version: v1 definition: - name: PlaylistTrack + name: PlaylistTrackBoolExp objectType: PlaylistTrack - filterableFields: - - fieldName: PlaylistId + dataConnectorName: mongodb + dataConnectorObjectType: PlaylistTrack + comparableFields: + - fieldName: id operators: enableAll: true - - fieldName: TrackId + - fieldName: playlistId operators: enableAll: true - - fieldName: _id + - fieldName: trackId operators: enableAll: true + graphql: + typeName: App_PlaylistTrackBoolExp + +--- +kind: Model +version: v1 +definition: + name: PlaylistTrack + objectType: PlaylistTrack + source: + dataConnectorName: mongodb + collection: PlaylistTrack + filterExpressionType: PlaylistTrackBoolExp orderableFields: - - fieldName: PlaylistId + - fieldName: id orderByDirections: enableAll: true - - fieldName: TrackId + - fieldName: playlistId orderByDirections: enableAll: true - - fieldName: _id + - fieldName: trackId orderByDirections: enableAll: true - arguments: [] graphql: + selectMany: + queryRootField: playlistTrack selectUniques: - queryRootField: playlistTrackById uniqueIdentifier: - - _id - selectMany: - queryRootField: playlistTrack - filterExpressionType: playlistTrackBoolExp - orderByExpressionType: playlistTrackOrderBy - source: - collection: PlaylistTrack - dataConnectorName: mongodb + - id + orderByExpressionType: App_PlaylistTrackOrderBy --- kind: ModelPermissions @@ -75,3 +99,4 @@ definition: - role: admin select: filter: null + diff --git a/fixtures/ddn/subgraphs/chinook/models/Track.hml b/fixtures/ddn/subgraphs/chinook/models/Track.hml index 5b6312e3..69a1881e 100644 --- a/fixtures/ddn/subgraphs/chinook/models/Track.hml +++ b/fixtures/ddn/subgraphs/chinook/models/Track.hml @@ -1,31 +1,66 @@ +--- kind: ObjectType version: v1 definition: name: Track - graphql: - typeName: track - inputTypeName: trackInput fields: - - name: AlbumId - type: Int - - name: Bytes - type: Int - - name: Composer - type: String - - name: GenreId - type: Int - - name: MediaTypeId + - name: id + type: ObjectId! + - name: albumId type: Int! - - name: Milliseconds + - name: bytes type: Int! - - name: Name + - name: composer type: String! - - name: TrackId + - name: genreId + type: Int! + - name: mediaTypeId + type: Int! + - name: milliseconds type: Int! - - name: UnitPrice + - name: name + type: String! + - name: trackId + type: Int! + - name: unitPrice type: Float! - - name: _id - type: ObjectId + graphql: + typeName: App_Track + inputTypeName: App_TrackInput + dataConnectorTypeMapping: + - dataConnectorName: mongodb + 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 @@ -36,98 +71,108 @@ definition: - role: admin output: allowedFields: - - AlbumId - - Bytes - - Composer - - GenreId - - MediaTypeId - - Milliseconds - - Name - - TrackId - - UnitPrice - - _id + - id + - albumId + - bytes + - composer + - genreId + - mediaTypeId + - milliseconds + - name + - trackId + - unitPrice --- -kind: Model +kind: ObjectBooleanExpressionType version: v1 definition: - name: Track + name: TrackBoolExp objectType: Track - filterableFields: - - fieldName: AlbumId + dataConnectorName: mongodb + dataConnectorObjectType: Track + comparableFields: + - fieldName: id operators: enableAll: true - - fieldName: Bytes + - fieldName: albumId operators: enableAll: true - - fieldName: Composer + - fieldName: bytes operators: enableAll: true - - fieldName: GenreId + - fieldName: composer operators: enableAll: true - - fieldName: MediaTypeId + - fieldName: genreId operators: enableAll: true - - fieldName: Milliseconds + - fieldName: mediaTypeId operators: enableAll: true - - fieldName: Name + - fieldName: milliseconds operators: enableAll: true - - fieldName: TrackId + - fieldName: name operators: enableAll: true - - fieldName: UnitPrice + - fieldName: trackId operators: enableAll: true - - fieldName: _id + - fieldName: unitPrice operators: enableAll: true + graphql: + typeName: App_TrackBoolExp + +--- +kind: Model +version: v1 +definition: + name: Track + objectType: Track + source: + dataConnectorName: mongodb + collection: Track + filterExpressionType: TrackBoolExp orderableFields: - - fieldName: AlbumId + - fieldName: id orderByDirections: enableAll: true - - fieldName: Bytes + - fieldName: albumId orderByDirections: enableAll: true - - fieldName: Composer + - fieldName: bytes orderByDirections: enableAll: true - - fieldName: GenreId + - fieldName: composer orderByDirections: enableAll: true - - fieldName: MediaTypeId + - fieldName: genreId orderByDirections: enableAll: true - - fieldName: Milliseconds + - fieldName: mediaTypeId orderByDirections: enableAll: true - - fieldName: Name + - fieldName: milliseconds orderByDirections: enableAll: true - - fieldName: TrackId + - fieldName: name orderByDirections: enableAll: true - - fieldName: UnitPrice + - fieldName: trackId orderByDirections: enableAll: true - - fieldName: _id + - fieldName: unitPrice orderByDirections: enableAll: true - arguments: [] graphql: + selectMany: + queryRootField: track selectUniques: - queryRootField: trackById uniqueIdentifier: - - _id - selectMany: - queryRootField: track - filterExpressionType: trackBoolExp - orderByExpressionType: trackOrderBy - source: - collection: Track - dataConnectorName: mongodb + - id + orderByExpressionType: App_TrackOrderBy --- kind: ModelPermissions @@ -138,3 +183,4 @@ definition: - role: admin select: filter: null + diff --git a/fixtures/ddn/subgraphs/chinook/relationships/album_artist.hml b/fixtures/ddn/subgraphs/chinook/relationships/album_artist.hml index 8f15d9b7..3e7f8104 100644 --- a/fixtures/ddn/subgraphs/chinook/relationships/album_artist.hml +++ b/fixtures/ddn/subgraphs/chinook/relationships/album_artist.hml @@ -1,7 +1,7 @@ kind: Relationship version: v1 definition: - name: Artist + name: artist source: Album target: model: @@ -10,7 +10,7 @@ definition: mapping: - source: fieldPath: - - fieldName: ArtistId + - fieldName: artistId target: modelField: - - fieldName: ArtistId + - fieldName: artistId diff --git a/fixtures/ddn/subgraphs/chinook/relationships/artist_albums.hml b/fixtures/ddn/subgraphs/chinook/relationships/artist_albums.hml index bfcdeb61..aa91a699 100644 --- a/fixtures/ddn/subgraphs/chinook/relationships/artist_albums.hml +++ b/fixtures/ddn/subgraphs/chinook/relationships/artist_albums.hml @@ -1,7 +1,7 @@ kind: Relationship version: v1 definition: - name: Albums + name: albums source: Artist target: model: @@ -10,7 +10,7 @@ definition: mapping: - source: fieldPath: - - fieldName: ArtistId + - fieldName: artistId target: modelField: - - fieldName: ArtistId + - fieldName: artistId diff --git a/flake.lock b/flake.lock index dabf16eb..5344b876 100644 --- a/flake.lock +++ b/flake.lock @@ -59,6 +59,23 @@ "type": "github" } }, + "dev-auth-webhook-source": { + "flake": false, + "locked": { + "lastModified": 1712739493, + "narHash": "sha256-kBtsPnuNLG5zuwmDAHQafyzDHodARBKlSBJXDlFE/7U=", + "owner": "hasura", + "repo": "graphql-engine", + "rev": "50f1243a46e22f0fecca03364b0b181fbb3735c6", + "type": "github" + }, + "original": { + "owner": "hasura", + "repo": "graphql-engine", + "rev": "50f1243a46e22f0fecca03364b0b181fbb3735c6", + "type": "github" + } + }, "flake-compat": { "locked": { "lastModified": 1696426674, @@ -134,6 +151,22 @@ "type": "github" } }, + "graphql-engine-source": { + "flake": false, + "locked": { + "lastModified": 1712845182, + "narHash": "sha256-Pam+Gf7ve+AuTTHE1BRC3tjhHJqV2xoR3jRDRZ04q5c=", + "owner": "hasura", + "repo": "graphql-engine", + "rev": "4bc2f21f801055796f008ce0d8da44a57283bca1", + "type": "github" + }, + "original": { + "owner": "hasura", + "repo": "graphql-engine", + "type": "github" + } + }, "haskell-flake": { "locked": { "lastModified": 1675296942, @@ -193,12 +226,13 @@ "advisory-db": "advisory-db", "arion": "arion", "crane": "crane", + "dev-auth-webhook-source": "dev-auth-webhook-source", "flake-compat": "flake-compat", + "graphql-engine-source": "graphql-engine-source", "nixpkgs": "nixpkgs", "rust-overlay": "rust-overlay", "systems": "systems_2", - "v3-e2e-testing-source": "v3-e2e-testing-source", - "v3-engine-source": "v3-engine-source" + "v3-e2e-testing-source": "v3-e2e-testing-source" } }, "rust-overlay": { @@ -268,22 +302,6 @@ "type": "git", "url": "ssh://git@github.com/hasura/v3-e2e-testing" } - }, - "v3-engine-source": { - "flake": false, - "locked": { - "lastModified": 1708518175, - "narHash": "sha256-UqmrwcyptOOh/sWlTml5i6PRAWoNScC8Kjqgl59PsPU=", - "ref": "refs/heads/main", - "rev": "0f36da2472c44a1e403bc2fa10ebbc377daeba0d", - "revCount": 344, - "type": "git", - "url": "ssh://git@github.com/hasura/v3-engine" - }, - "original": { - "type": "git", - "url": "ssh://git@github.com/hasura/v3-engine" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index e197d363..63b6f573 100644 --- a/flake.nix +++ b/flake.nix @@ -27,26 +27,34 @@ # We need flake-compat in arion-pkgs.nix flake-compat.url = "github:edolstra/flake-compat"; - # This gets the source for the v3-engine. We use an expression in - # ./nix/v3-engine.nix to build. This is used to produce an arion service. + # This gets the source for the graphql engine. We use an expression in + # ./nix/graphql-engine.nix to build. This is used to produce an arion + # service. # # To test against local engine changes, change the url here to: # - # url = "git+file:///home/me/path/to/v3-engine" + # url = "git+file:///home/me/path/to/graphql-engine" # # If source changes aren't picked up automatically try: # # - committing changes to the local engine repo - # - running `nix flake lock --update-input v3-engine-source` in this repo + # - running `nix flake lock --update-input graphql-engine-source` in this repo # - arion up -d engine # - v3-engine-source = { - url = "git+ssh://git@github.com/hasura/v3-engine"; + graphql-engine-source = { + url = "github:hasura/graphql-engine"; flake = false; }; - # See the note above on v3-engine-source for information on running against - # a version of v3-e2e-testing with local changes. + # This is a copy of graphql-engine-source that is pinned to a revision where + # dev-auth-webhook can be built independently. + dev-auth-webhook-source = { + url = "github:hasura/graphql-engine/50f1243a46e22f0fecca03364b0b181fbb3735c6"; + flake = false; + }; + + # See the note above on graphql-engine-source for information on running + # against a version of v3-e2e-testing with local changes. v3-e2e-testing-source = { url = "git+ssh://git@github.com/hasura/v3-e2e-testing?ref=jesse/update-mongodb"; flake = false; @@ -60,7 +68,8 @@ , rust-overlay , advisory-db , arion - , v3-engine-source + , graphql-engine-source + , dev-auth-webhook-source , v3-e2e-testing-source , systems , ... @@ -84,16 +93,16 @@ rustToolchain = final.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; craneLib = (crane.mkLib final).overrideToolchain rustToolchain; - # Extend our package set with mongodb-connector, v3-engine, and other - # packages built by this flake to make these packages accessible in - # arion-compose.nix. + # Extend our package set with mongodb-connector, graphql-engine, and + # other packages built by this flake to make these packages accessible + # in arion-compose.nix. mongodb-connector-workspace = final.callPackage ./nix/mongodb-connector-workspace.nix { }; # builds all packages in this repo mongodb-connector = final.mongodb-connector-workspace.override { package = "mongodb-connector"; }; # override `package` to build one specific crate mongodb-cli-plugin = final.mongodb-connector-workspace.override { package = "mongodb-cli-plugin"; }; - v3-engine = final.callPackage ./nix/v3-engine.nix { src = v3-engine-source; }; + graphql-engine = final.callPackage ./nix/graphql-engine.nix { src = "${graphql-engine-source}/v3"; package = "engine"; }; v3-e2e-testing = final.callPackage ./nix/v3-e2e-testing.nix { src = v3-e2e-testing-source; database-to-test = "mongodb"; }; inherit v3-e2e-testing-source; # include this source so we can read files from it in arion-compose configs - dev-auth-webhook = final.callPackage ./nix/dev-auth-webhook.nix { src = "${v3-engine-source}/hasura-authn-webhook/dev-auth-webhook"; }; + dev-auth-webhook = final.callPackage ./nix/dev-auth-webhook.nix { src = "${dev-auth-webhook-source}/v3/crates/hasura-authn-webhook/dev-auth-webhook"; }; # Provide cross-compiled versions of each of our packages under # `pkgs.pkgsCross.${system}.${package-name}` @@ -194,7 +203,7 @@ }); # Export our nixpkgs package set, which has been extended with the - # mongodb-connector, v3-engine, etc. We do this so that arion can pull in + # mongodb-connector, graphql-engine, etc. We do this so that arion can pull in # the same package set through arion-pkgs.nix. legacyPackages = eachSystem (pkgs: pkgs); diff --git a/nix/dev-auth-webhook.nix b/nix/dev-auth-webhook.nix index e17059ea..563ed256 100644 --- a/nix/dev-auth-webhook.nix +++ b/nix/dev-auth-webhook.nix @@ -1,36 +1,30 @@ -# Used to fake auth checks when running v3-engine locally. -# -# Creates a derivation that includes `index.js` and `node_modules`. To run it -# use a command like, -# -# node ${pkgs.dev-auth-webhook}/index.js +# Used to fake auth checks when running graphql-engine locally. # { src # The following arguments come from nixpkgs, and are automatically populated # by `callPackage`. -, fetchNpmDeps -, nodejs -, stdenvNoCC +, callPackage +, craneLib }: let - npmDeps = fetchNpmDeps { - inherit src; - name = "dev-auth-webhook-npm-deps"; - hash = "sha256-s2s5JeaiUsh0mYqh5BYfZ7uEnsPv2YzpOUQoMZj1MR0="; - }; + boilerplate = callPackage ./cargo-boilerplate.nix { }; + recursiveMerge = callPackage ./recursiveMerge.nix { }; + + buildArgs = recursiveMerge [ + boilerplate.buildArgs + { + inherit src; + pname = "dev-auth-webhook"; + version = "3.0.0"; + doCheck = false; + } + ]; + + cargoArtifacts = craneLib.buildDepsOnly buildArgs; in -stdenvNoCC.mkDerivation { - inherit src; - name = "dev-auth-webhook"; - nativeBuildInputs = [ nodejs ]; - buildPhase = '' - npm install --cache "${npmDeps}" - ''; - installPhase = '' - mkdir -p "$out" - cp index.js "$out/" - cp -r node_modules "$out/" - ''; -} +craneLib.buildPackage + (buildArgs // { + inherit cargoArtifacts; + }) diff --git a/nix/v3-engine.nix b/nix/graphql-engine.nix similarity index 81% rename from nix/v3-engine.nix rename to nix/graphql-engine.nix index 021dd1b0..cd334abc 100644 --- a/nix/v3-engine.nix +++ b/nix/graphql-engine.nix @@ -1,4 +1,4 @@ -# Dependencies and build configuration for the v3-engine crate. +# Dependencies and build configuration for the graphql-engine crate. # # To add runtime library dependencies, add packge names to the argument set # here, and add the same name to the `buildInputs` list below. @@ -12,6 +12,7 @@ # https://crane.dev/API.html#cranelibbuildpackage # { src +, package ? null # leave as null to build or test all packages # The following arguments come from nixpkgs, and are automatically populated # by `callPackage`. @@ -33,8 +34,12 @@ let inherit src; # craneLib wants a name for the workspace root - pname = "v3-engine-workspace"; - version = "3.0.0"; + pname = if package != null then "hasura-${package}" else "graphql-engine-workspace"; + + cargoExtraArgs = + if package == null + then "--locked" + else "--locked --package ${package}"; buildInputs = [ openssl