Skip to content

Commit

Permalink
update local services and fixtures to use latest engine version (#33)
Browse files Browse the repository at this point in the history
Update local docker-compose configuration to use the latest engine version. This also switches to pulling engine source from the open source repo.

The implementation for dev-auth-webhook changed to a Rust project, so the nix configuration is updated accordingly.

Ticket: https://hasurahq.atlassian.net/browse/MDB-109
  • Loading branch information
hallettj authored Apr 12, 2024
1 parent 1b96bb8 commit 9b43d58
Show file tree
Hide file tree
Showing 22 changed files with 1,194 additions and 831 deletions.
9 changes: 4 additions & 5 deletions arion-compose/service-dev-auth-webhook.nix
Original file line number Diff line number Diff line change
@@ -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"
];
};
}
4 changes: 2 additions & 2 deletions arion-compose/service-engine.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
'';

Expand All @@ -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;
Expand Down
15 changes: 9 additions & 6 deletions fixtures/ddn/subgraphs/chinook/commands/InsertArtist.hml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -55,4 +59,3 @@ definition:
allowedFields:
- ok
- n

33 changes: 26 additions & 7 deletions fixtures/ddn/subgraphs/chinook/dataconnectors/mongodb-types.hml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -13,7 +24,7 @@ definition:
dataConnectorScalarType: Int
representation: Int
graphql:
comparisonExpressionTypeName: MongodbIntComparisonExp
comparisonExpressionTypeName: App_IntComparisonExp

---
kind: DataConnectorScalarRepresentation
Expand All @@ -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
Expand All @@ -43,4 +62,4 @@ definition:
dataConnectorScalarType: Float
representation: Float
graphql:
comparisonExpressionTypeName: MongodbFloatComparisonExp
comparisonExpressionTypeName: App_FloatComparisonExp
Loading

0 comments on commit 9b43d58

Please sign in to comment.