diff --git a/.devcontainer/Dockerfile.backend b/.devcontainer/Dockerfile.backend index a68c3801..7f6f6045 100644 --- a/.devcontainer/Dockerfile.backend +++ b/.devcontainer/Dockerfile.backend @@ -8,6 +8,5 @@ RUN apt-get update \ libopencv-dev clang libclang-dev \ && rm -rf /var/lib/apt/lists/* -# Install Rover CLI for composing and precompiles rust router (gateway) for subgraphs -RUN curl -sSL https://rover.apollo.dev/nix/latest | sh\ - && curl -sSL https://router.apollo.dev/download/nix/latest | sh +# Install Rover CLI for composing subgraphs +RUN curl -sSL https://rover.apollo.dev/nix/latest | sh diff --git a/.devcontainer/docker-compose.yaml b/.devcontainer/docker-compose.yaml index 79a156b1..fa19ad44 100644 --- a/.devcontainer/docker-compose.yaml +++ b/.devcontainer/docker-compose.yaml @@ -1,6 +1,20 @@ version: "3.8" services: + apollo-router: + image: ghcr.io/apollographql/router:v1.41.0-rc.2 + volumes: + - ./supergraph.graphql:/dist/schema/supergraph.graphql + - ./router.yaml:/dist/config/router.yaml + ports: + - 4001:4000 + command: + - --dev + - -c + - config/router.yaml + - -s + - schema/supergraph.graphql + backend: build: context: . diff --git a/backend/router.yaml b/.devcontainer/router.yaml similarity index 53% rename from backend/router.yaml rename to .devcontainer/router.yaml index 59dab80b..af50558b 100644 --- a/backend/router.yaml +++ b/.devcontainer/router.yaml @@ -2,4 +2,8 @@ headers: all: # Header rules for all subgraphs request: - propagate: - matching: .* \ No newline at end of file + matching: .* + +supergraph: + listen: 0.0.0.0:4000 + \ No newline at end of file diff --git a/.gitignore b/.gitignore index 25e65aeb..8df3c614 100644 --- a/.gitignore +++ b/.gitignore @@ -4,8 +4,5 @@ # Developer Tooling .vscode -# Apollo router -router -backend/router # Generated supergraph schema -backend/supergraph.graphql +.devcontainer/supergraph.graphql diff --git a/backend/compound_library/src/graphql/compound_instances_res.rs b/backend/compound_library/src/graphql/compound_instances_res.rs index c8135180..622669ed 100644 --- a/backend/compound_library/src/graphql/compound_instances_res.rs +++ b/backend/compound_library/src/graphql/compound_instances_res.rs @@ -60,7 +60,7 @@ impl CompoundInstanceQuery { /// Reference resolver for compound instance in compound library subgraph #[graphql(entity)] - async fn get_compound_instance_by_id( + async fn route_compound_instance( &self, ctx: &Context<'_>, plate_id: Uuid, diff --git a/backend/compound_soaking/src/graphql/soak_compound_res.rs b/backend/compound_soaking/src/graphql/soak_compound_res.rs index c3120e19..7914da0c 100644 --- a/backend/compound_soaking/src/graphql/soak_compound_res.rs +++ b/backend/compound_soaking/src/graphql/soak_compound_res.rs @@ -107,7 +107,7 @@ impl SoakCompoundQuery { /// Reference resolver for crystal wells #[graphql(entity)] - async fn get_crystal_well_by_plate_id(&self, plate_id: Uuid, well_number: i16) -> CrystalWells { + async fn route_crystal_well(&self, plate_id: Uuid, well_number: i16) -> CrystalWells { CrystalWells { plate_id, well_number, @@ -116,7 +116,7 @@ impl SoakCompoundQuery { /// Reference resolver for compound wells #[graphql(entity)] - async fn get_compound_instances_by_plate_id( + async fn route_compound_instances( &self, plate_id: Uuid, well_number: i16, @@ -131,7 +131,7 @@ impl SoakCompoundQuery { #[Object] impl SoakCompoundMutation { /// Adds a soaked compound to the database - async fn add_soaked_compound( + async fn soak_compound( &self, ctx: &Context<'_>, compound_plate_id: Uuid, diff --git a/backend/compound_soaking/src/tables/soak_compound.rs b/backend/compound_soaking/src/tables/soak_compound.rs index d752e2d4..8622344b 100644 --- a/backend/compound_soaking/src/tables/soak_compound.rs +++ b/backend/compound_soaking/src/tables/soak_compound.rs @@ -23,7 +23,7 @@ pub struct Model { /// The well on the plate which the crystal is located. #[sea_orm(primary_key, auto_increment = false)] pub crystal_well_number: i16, - /// The volume of compounds soaked. + /// The volume of compounds transferred into the crystal well. pub volume: f32, /// The identifier of the operator which added this entry. pub operator_id: String, diff --git a/backend/crystal_library/src/graphql/crystal_wells_res.rs b/backend/crystal_library/src/graphql/crystal_wells_res.rs index 6b0b3bc4..905ebe97 100644 --- a/backend/crystal_library/src/graphql/crystal_wells_res.rs +++ b/backend/crystal_library/src/graphql/crystal_wells_res.rs @@ -62,7 +62,7 @@ impl CrystalWellsQuery { /// Reference resolver for crystal wells in crystal library graphql subgraph #[graphql(entity)] - async fn find_crystal_wells_by_id( + async fn route_crystal_wells( &self, ctx: &Context<'_>, plate_id: Uuid, diff --git a/backend/supergraph-config.yaml b/backend/supergraph-config.yaml index a3b9245c..522ffb91 100644 --- a/backend/supergraph-config.yaml +++ b/backend/supergraph-config.yaml @@ -1,14 +1,15 @@ federation_version: 2 subgraphs: crystal_library: - routing_url: http://localhost:80 + routing_url: http://backend:80 schema: - subgraph_url: http://localhost:80 + subgraph_url: http://backend:80 compound_library: - routing_url: http://localhost:81 + routing_url: http://backend:81 schema: - subgraph_url: http://localhost:81 + subgraph_url: http://backend:81 compound_soaking: - routing_url: http://localhost:82 + routing_url: http://backend:82 schema: - subgraph_url: http://localhost:82 \ No newline at end of file + subgraph_url: http://backend:82 + \ No newline at end of file