From fb60757a30f1597811197fca4099c2a8d5f1ad5f Mon Sep 17 00:00:00 2001 From: Kamil Kisiela Date: Wed, 6 Nov 2024 10:35:09 +0100 Subject: [PATCH 01/10] Add Inigo Gateway --- federation-v1/gateways/inigo/Dockerfile | 8 ++ federation-v1/gateways/inigo/config.yaml | 1 + .../gateways/inigo/docker-compose.yaml | 35 ++++++++ .../gateways/inigo/supergraph.graphql | 89 +++++++++++++++++++ 4 files changed, 133 insertions(+) create mode 100644 federation-v1/gateways/inigo/Dockerfile create mode 100644 federation-v1/gateways/inigo/config.yaml create mode 100644 federation-v1/gateways/inigo/docker-compose.yaml create mode 100644 federation-v1/gateways/inigo/supergraph.graphql diff --git a/federation-v1/gateways/inigo/Dockerfile b/federation-v1/gateways/inigo/Dockerfile new file mode 100644 index 00000000..2b3504bb --- /dev/null +++ b/federation-v1/gateways/inigo/Dockerfile @@ -0,0 +1,8 @@ +FROM inigohub/gateway:v0.30.13 + +COPY supergraph.graphql ./ +COPY config.yaml ./ + +EXPOSE 4000 + +CMD ["--schema", "supergraph.graphql", "--config", "config.yaml"] diff --git a/federation-v1/gateways/inigo/config.yaml b/federation-v1/gateways/inigo/config.yaml new file mode 100644 index 00000000..543be13e --- /dev/null +++ b/federation-v1/gateways/inigo/config.yaml @@ -0,0 +1 @@ +listen_port: 4000 \ No newline at end of file diff --git a/federation-v1/gateways/inigo/docker-compose.yaml b/federation-v1/gateways/inigo/docker-compose.yaml new file mode 100644 index 00000000..cda86655 --- /dev/null +++ b/federation-v1/gateways/inigo/docker-compose.yaml @@ -0,0 +1,35 @@ +version: "3.8" + +services: + gateway: + image: gateway/inigo + container_name: gateway + build: + context: ${BASE_DIR:-.}/../../gateways/inigo + dockerfile: ./Dockerfile + networks: + - test + ports: + - "0.0.0.0:4000:4000" + depends_on: + accounts: + condition: service_healthy + inventory: + condition: service_healthy + products: + condition: service_healthy + reviews: + condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-f", "-X", "GET", "http://localhost:4000/health"] + interval: 3s + timeout: 5s + retries: 10 + deploy: + resources: + limits: + cpus: ${CPU_LIMIT:-1} + memory: ${MEM_LIMIT:-1gb} +networks: + test: + name: test diff --git a/federation-v1/gateways/inigo/supergraph.graphql b/federation-v1/gateways/inigo/supergraph.graphql new file mode 100644 index 00000000..c7995b32 --- /dev/null +++ b/federation-v1/gateways/inigo/supergraph.graphql @@ -0,0 +1,89 @@ +schema + @link(url: "https://specs.apollo.dev/link/v1.0") + @link(url: "https://specs.apollo.dev/join/v0.3", for: EXECUTION) +{ + query: Query +} + +directive @join__enumValue(graph: join__Graph!) repeatable on ENUM_VALUE + +directive @join__field(graph: join__Graph, requires: join__FieldSet, provides: join__FieldSet, type: String, external: Boolean, override: String, usedOverridden: Boolean) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION + +directive @join__graph(name: String!, url: String!) on ENUM_VALUE + +directive @join__implements(graph: join__Graph!, interface: String!) repeatable on OBJECT | INTERFACE + +directive @join__type(graph: join__Graph!, key: join__FieldSet, extension: Boolean! = false, resolvable: Boolean! = true, isInterfaceObject: Boolean! = false) repeatable on OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT | SCALAR + +directive @join__unionMember(graph: join__Graph!, member: String!) repeatable on UNION + +directive @link(url: String, as: String, for: link__Purpose, import: [link__Import]) repeatable on SCHEMA + +scalar join__FieldSet + +enum join__Graph { + ACCOUNTS @join__graph(name: "accounts", url: "http://accounts:4001/graphql") + INVENTORY @join__graph(name: "inventory", url: "http://inventory:4002/graphql") + PRODUCTS @join__graph(name: "products", url: "http://products:4003/graphql") + REVIEWS @join__graph(name: "reviews", url: "http://reviews:4004/graphql") +} + +scalar link__Import + +enum link__Purpose { + """ + `SECURITY` features provide metadata necessary to securely resolve fields. + """ + SECURITY + + """ + `EXECUTION` features provide metadata necessary for operation execution. + """ + EXECUTION +} + +type Product + @join__type(graph: INVENTORY, key: "upc") + @join__type(graph: PRODUCTS, key: "upc") + @join__type(graph: REVIEWS, key: "upc") +{ + upc: String! + weight: Int @join__field(graph: INVENTORY, external: true) @join__field(graph: PRODUCTS) + price: Int @join__field(graph: INVENTORY, external: true) @join__field(graph: PRODUCTS) + inStock: Boolean @join__field(graph: INVENTORY) + shippingEstimate: Int @join__field(graph: INVENTORY, requires: "price weight") + name: String @join__field(graph: PRODUCTS) + reviews: [Review] @join__field(graph: REVIEWS) +} + +type Query + @join__type(graph: ACCOUNTS) + @join__type(graph: INVENTORY) + @join__type(graph: PRODUCTS) + @join__type(graph: REVIEWS) +{ + me: User @join__field(graph: ACCOUNTS) + user(id: ID!): User @join__field(graph: ACCOUNTS) + users: [User] @join__field(graph: ACCOUNTS) + topProducts(first: Int = 5): [Product] @join__field(graph: PRODUCTS) +} + +type Review + @join__type(graph: REVIEWS, key: "id") +{ + id: ID! + body: String + product: Product + author: User @join__field(graph: REVIEWS, provides: "username") +} + +type User + @join__type(graph: ACCOUNTS, key: "id") + @join__type(graph: REVIEWS, key: "id") +{ + id: ID! + name: String @join__field(graph: ACCOUNTS) + username: String @join__field(graph: ACCOUNTS) @join__field(graph: REVIEWS, external: true) + birthday: Int @join__field(graph: ACCOUNTS) + reviews: [Review] @join__field(graph: REVIEWS) +} \ No newline at end of file From 5c47be4a0a64d7cd91d113d5bb1af51283cb49f0 Mon Sep 17 00:00:00 2001 From: Kamil Kisiela Date: Wed, 6 Nov 2024 13:19:57 +0100 Subject: [PATCH 02/10] logs --- .../constant-vus-over-time/generate-report.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/federation/scenarios/constant-vus-over-time/generate-report.ts b/federation/scenarios/constant-vus-over-time/generate-report.ts index f1a6607d..a8005638 100644 --- a/federation/scenarios/constant-vus-over-time/generate-report.ts +++ b/federation/scenarios/constant-vus-over-time/generate-report.ts @@ -217,6 +217,27 @@ async function generateReport(artifactsRootPath: string) { (c) => c.name === "valid response structure" ); + function logRawReport() { + console.log("Raw report for:", v.name); + console.log("--"); + console.log(JSON.stringify(checks, null, 2)); + console.log("--"); + } + + if (!http200Check) { + logRawReport(); + throw new Error("Could not find 'response code was 200' check!"); + } + + if (!graphqlErrors) { + logRawReport(); + throw new Error("Could not find 'no graphql errors' check!"); + } + + if (!responseStructure) { + logRawReport(); + throw new Error("Could not find 'valid response structure' check!"); + } if (http200Check.fails > 0) { notes.push(`${http200Check.fails} non-200 responses`); From bced38caf03351211ded7e063b6133c5de85f05f Mon Sep 17 00:00:00 2001 From: Kamil Kisiela Date: Wed, 6 Nov 2024 13:52:01 +0100 Subject: [PATCH 03/10] add --- .github/workflows/federation-v1.workflow.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/federation-v1.workflow.yaml b/.github/workflows/federation-v1.workflow.yaml index 33552446..fe4febab 100644 --- a/.github/workflows/federation-v1.workflow.yaml +++ b/.github/workflows/federation-v1.workflow.yaml @@ -34,6 +34,7 @@ jobs: - cosmo - mercurius - grafbase + - inigo uses: ./.github/workflows/benchmark.template.yaml with: gateway: ${{ matrix.directory }} From 05fefeb83f395bef7447d8ac4d2bd048bfacab62 Mon Sep 17 00:00:00 2001 From: Kamil Kisiela Date: Wed, 6 Nov 2024 15:32:13 +0100 Subject: [PATCH 04/10] running --- federation-v1/gateways/inigo/Dockerfile | 10 +- .../gateways/inigo/supergraph.graphql | 116 ++++++++++-------- 2 files changed, 73 insertions(+), 53 deletions(-) diff --git a/federation-v1/gateways/inigo/Dockerfile b/federation-v1/gateways/inigo/Dockerfile index 2b3504bb..4e6bd097 100644 --- a/federation-v1/gateways/inigo/Dockerfile +++ b/federation-v1/gateways/inigo/Dockerfile @@ -1,8 +1,14 @@ -FROM inigohub/gateway:v0.30.13 +# we need curl to perform health checks +# and that's why we start with alpine image +# and copy the gateway binary from the original docker image +FROM alpine:3.19 +RUN apk add --no-cache curl + +COPY --from=inigohub/gateway:v0.30.13 /usr/bin/gateway . COPY supergraph.graphql ./ COPY config.yaml ./ EXPOSE 4000 -CMD ["--schema", "supergraph.graphql", "--config", "config.yaml"] +CMD ["./gateway", "--schema", "supergraph.graphql", "--config", "config.yaml"] diff --git a/federation-v1/gateways/inigo/supergraph.graphql b/federation-v1/gateways/inigo/supergraph.graphql index c7995b32..43dc2879 100644 --- a/federation-v1/gateways/inigo/supergraph.graphql +++ b/federation-v1/gateways/inigo/supergraph.graphql @@ -1,89 +1,103 @@ +# Generated by Inigo CLI + schema - @link(url: "https://specs.apollo.dev/link/v1.0") - @link(url: "https://specs.apollo.dev/join/v0.3", for: EXECUTION) -{ + @link(for: EXECUTION, url: "https://specs.apollo.dev/join/v0.2") + @link(url: "https://specs.apollo.dev/link/v1.0") { query: Query } -directive @join__enumValue(graph: join__Graph!) repeatable on ENUM_VALUE - -directive @join__field(graph: join__Graph, requires: join__FieldSet, provides: join__FieldSet, type: String, external: Boolean, override: String, usedOverridden: Boolean) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION - -directive @join__graph(name: String!, url: String!) on ENUM_VALUE - -directive @join__implements(graph: join__Graph!, interface: String!) repeatable on OBJECT | INTERFACE - -directive @join__type(graph: join__Graph!, key: join__FieldSet, extension: Boolean! = false, resolvable: Boolean! = true, isInterfaceObject: Boolean! = false) repeatable on OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT | SCALAR - -directive @join__unionMember(graph: join__Graph!, member: String!) repeatable on UNION - -directive @link(url: String, as: String, for: link__Purpose, import: [link__Import]) repeatable on SCHEMA - scalar join__FieldSet +scalar link__Import enum join__Graph { ACCOUNTS @join__graph(name: "accounts", url: "http://accounts:4001/graphql") - INVENTORY @join__graph(name: "inventory", url: "http://inventory:4002/graphql") + INVENTORY + @join__graph(name: "inventory", url: "http://inventory:4002/graphql") PRODUCTS @join__graph(name: "products", url: "http://products:4003/graphql") REVIEWS @join__graph(name: "reviews", url: "http://reviews:4004/graphql") } - -scalar link__Import - enum link__Purpose { - """ - `SECURITY` features provide metadata necessary to securely resolve fields. - """ - SECURITY - """ `EXECUTION` features provide metadata necessary for operation execution. """ EXECUTION + """ + `SECURITY` features provide metadata necessary to securely resolve fields. + """ + SECURITY } type Product - @join__type(graph: INVENTORY, key: "upc") - @join__type(graph: PRODUCTS, key: "upc") - @join__type(graph: REVIEWS, key: "upc") -{ - upc: String! - weight: Int @join__field(graph: INVENTORY, external: true) @join__field(graph: PRODUCTS) - price: Int @join__field(graph: INVENTORY, external: true) @join__field(graph: PRODUCTS) + @join__type(extension: true, graph: INVENTORY, key: "upc") + @join__type(extension: true, graph: REVIEWS, key: "upc") + @join__type(graph: PRODUCTS, key: "upc") { inStock: Boolean @join__field(graph: INVENTORY) - shippingEstimate: Int @join__field(graph: INVENTORY, requires: "price weight") name: String @join__field(graph: PRODUCTS) + price: Int + @join__field(external: true, graph: INVENTORY) + @join__field(graph: PRODUCTS) reviews: [Review] @join__field(graph: REVIEWS) + shippingEstimate: Int @join__field(graph: INVENTORY, requires: "price weight") + upc: String! + weight: Int + @join__field(external: true, graph: INVENTORY) + @join__field(graph: PRODUCTS) } - type Query @join__type(graph: ACCOUNTS) @join__type(graph: INVENTORY) @join__type(graph: PRODUCTS) - @join__type(graph: REVIEWS) -{ + @join__type(graph: REVIEWS) { me: User @join__field(graph: ACCOUNTS) + topProducts(first: Int = 5): [Product] @join__field(graph: PRODUCTS) user(id: ID!): User @join__field(graph: ACCOUNTS) users: [User] @join__field(graph: ACCOUNTS) - topProducts(first: Int = 5): [Product] @join__field(graph: PRODUCTS) } - -type Review - @join__type(graph: REVIEWS, key: "id") -{ - id: ID! +type Review @join__type(graph: REVIEWS, key: "id") { + author: User @join__field(graph: REVIEWS, provides: "username") body: String + id: ID! product: Product - author: User @join__field(graph: REVIEWS, provides: "username") } - type User - @join__type(graph: ACCOUNTS, key: "id") - @join__type(graph: REVIEWS, key: "id") -{ + @join__type(extension: true, graph: REVIEWS, key: "id") + @join__type(graph: ACCOUNTS, key: "id") { + birthday: Int @join__field(graph: ACCOUNTS) id: ID! name: String @join__field(graph: ACCOUNTS) - username: String @join__field(graph: ACCOUNTS) @join__field(graph: REVIEWS, external: true) - birthday: Int @join__field(graph: ACCOUNTS) reviews: [Review] @join__field(graph: REVIEWS) -} \ No newline at end of file + username: String + @join__field(external: true, graph: REVIEWS) + @join__field(graph: ACCOUNTS) +} + +directive @join__field( + external: Boolean + graph: join__Graph! + override: String + provides: join__FieldSet + requires: join__FieldSet + type: String + usedOverridden: Boolean +) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION + +directive @join__graph(name: String!, url: String!) on ENUM_VALUE + +directive @join__implements( + graph: join__Graph! + interface: String! +) repeatable on OBJECT | INTERFACE + +directive @join__type( + extension: Boolean! = false + graph: join__Graph! + key: join__FieldSet + resolvable: Boolean! = true +) repeatable on OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT | SCALAR + +directive @link( + as: String + for: link__Purpose + import: [link__Import] + url: String +) repeatable on SCHEMA From 58c150f63de222dce510b032f1d90db8435992cb Mon Sep 17 00:00:00 2001 From: Kamil Kisiela Date: Wed, 6 Nov 2024 15:39:41 +0100 Subject: [PATCH 05/10] . --- .github/workflows/federation-v1.workflow.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/federation-v1.workflow.yaml b/.github/workflows/federation-v1.workflow.yaml index fe4febab..39ca1288 100644 --- a/.github/workflows/federation-v1.workflow.yaml +++ b/.github/workflows/federation-v1.workflow.yaml @@ -72,6 +72,7 @@ jobs: - cosmo - mercurius - grafbase + - inigo uses: ./.github/workflows/benchmark.template.yaml with: gateway: ${{ matrix.directory }} @@ -110,6 +111,7 @@ jobs: - cosmo - mercurius - grafbase + - inigo uses: ./.github/workflows/benchmark.template.yaml with: gateway: ${{ matrix.directory }} @@ -148,6 +150,7 @@ jobs: - cosmo - mercurius - grafbase + - inigo uses: ./.github/workflows/benchmark.template.yaml with: gateway: ${{ matrix.directory }} From 857286e064d87605f129c8c35f95343e1370a846 Mon Sep 17 00:00:00 2001 From: Kamil Kisiela Date: Wed, 6 Nov 2024 15:59:26 +0100 Subject: [PATCH 06/10] grafbase --- federation/gateways/grafbase/Dockerfile | 3 ++- federation/gateways/grafbase/grafbase.toml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 federation/gateways/grafbase/grafbase.toml diff --git a/federation/gateways/grafbase/Dockerfile b/federation/gateways/grafbase/Dockerfile index a68528da..1b66c056 100644 --- a/federation/gateways/grafbase/Dockerfile +++ b/federation/gateways/grafbase/Dockerfile @@ -1,7 +1,8 @@ FROM ghcr.io/grafbase/gateway:0.30.2 COPY supergraph.graphql ./ +COPY grafbase.toml ./ EXPOSE 4000 -CMD ["--schema", "supergraph.graphql", "--listen-address", "0.0.0.0:4000"] +CMD ["--schema", "supergraph.graphql", "--listen-address", "0.0.0.0:4000", "-c", "grafbase.toml"] diff --git a/federation/gateways/grafbase/grafbase.toml b/federation/gateways/grafbase/grafbase.toml new file mode 100644 index 00000000..be2f2d38 --- /dev/null +++ b/federation/gateways/grafbase/grafbase.toml @@ -0,0 +1,2 @@ + +request_body_limit = "2MiB" From 1c4413e6c161c6825079f1f55f2240335c64fe9d Mon Sep 17 00:00:00 2001 From: Kamil Kisiela Date: Fri, 22 Nov 2024 09:02:48 +0100 Subject: [PATCH 07/10] Latest --- federation-v1/gateways/inigo/Dockerfile | 2 +- federation/gateways/hive-gateway/docker-compose.yaml | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/federation-v1/gateways/inigo/Dockerfile b/federation-v1/gateways/inigo/Dockerfile index 4e6bd097..eafe17ea 100644 --- a/federation-v1/gateways/inigo/Dockerfile +++ b/federation-v1/gateways/inigo/Dockerfile @@ -4,7 +4,7 @@ FROM alpine:3.19 RUN apk add --no-cache curl -COPY --from=inigohub/gateway:v0.30.13 /usr/bin/gateway . +COPY --from=inigohub/gateway:v0.30.15 /usr/bin/gateway . COPY supergraph.graphql ./ COPY config.yaml ./ diff --git a/federation/gateways/hive-gateway/docker-compose.yaml b/federation/gateways/hive-gateway/docker-compose.yaml index cc7d15e9..e6a802d5 100644 --- a/federation/gateways/hive-gateway/docker-compose.yaml +++ b/federation/gateways/hive-gateway/docker-compose.yaml @@ -24,11 +24,18 @@ services: source: federation/gateways/hive-gateway/supergraph.graphql target: /serve/supergraph.graphql healthcheck: - test: [ "CMD", "/usr/lib/apt/apt-helper", "download-file", "http://127.0.0.1:4000/graphql?query=%7B+users+%7B+reviews+%7B+product+%7B+reviews+%7B+author+%7B+reviews+%7B+product+%7B+name+%7D+%7D+%7D+%7D+%7D+%7D+%7D+%7D", "/tmp/health" ] + test: + [ + "CMD", + "/usr/lib/apt/apt-helper", + "download-file", + "http://127.0.0.1:4000/graphql?query=%7B+users+%7B+reviews+%7B+product+%7B+reviews+%7B+author+%7B+reviews+%7B+product+%7B+name+%7D+%7D+%7D+%7D+%7D+%7D+%7D+%7D", + "/tmp/health", + ] interval: 3s timeout: 5s retries: 10 - command: [ "supergraph", "--jit" ] + command: ["supergraph", "--jit"] deploy: resources: limits: From 43b6f0f3c1b04063715837c99f916852e81995ef Mon Sep 17 00:00:00 2001 From: Arda TANRIKULU Date: Thu, 20 Mar 2025 19:11:22 +0300 Subject: [PATCH 08/10] Inigo --- federation/inigo/Dockerfile | 14 ++++ federation/inigo/config.yaml | 1 + federation/inigo/docker-compose.yaml | 35 +++++++++ federation/inigo/supergraph.graphql | 103 +++++++++++++++++++++++++++ 4 files changed, 153 insertions(+) create mode 100644 federation/inigo/Dockerfile create mode 100644 federation/inigo/config.yaml create mode 100644 federation/inigo/docker-compose.yaml create mode 100644 federation/inigo/supergraph.graphql diff --git a/federation/inigo/Dockerfile b/federation/inigo/Dockerfile new file mode 100644 index 00000000..eb21d0f9 --- /dev/null +++ b/federation/inigo/Dockerfile @@ -0,0 +1,14 @@ +# we need curl to perform health checks +# and that's why we start with alpine image +# and copy the gateway binary from the original docker image +FROM alpine:3.19 +RUN apk add --no-cache curl + +COPY --from=inigohub/gateway:v0.30.15 /usr/bin/gateway . + +COPY supergraph.graphql ./ +COPY config.yaml ./ + +EXPOSE 4000 + +CMD ["./gateway", "--schema", "supergraph.graphql", "--config", "config.yaml"] \ No newline at end of file diff --git a/federation/inigo/config.yaml b/federation/inigo/config.yaml new file mode 100644 index 00000000..543be13e --- /dev/null +++ b/federation/inigo/config.yaml @@ -0,0 +1 @@ +listen_port: 4000 \ No newline at end of file diff --git a/federation/inigo/docker-compose.yaml b/federation/inigo/docker-compose.yaml new file mode 100644 index 00000000..41d95816 --- /dev/null +++ b/federation/inigo/docker-compose.yaml @@ -0,0 +1,35 @@ +version: "3.8" + +services: + gateway: + image: gateway/inigo + container_name: gateway + build: + context: ${BASE_DIR:-.}/../../gateways/inigo + dockerfile: ./Dockerfile + networks: + - test + ports: + - "0.0.0.0:4000:4000" + depends_on: + accounts: + condition: service_healthy + inventory: + condition: service_healthy + products: + condition: service_healthy + reviews: + condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-f", "-X", "GET", "http://localhost:4000/health"] + interval: 3s + timeout: 5s + retries: 10 + deploy: + resources: + limits: + cpus: ${CPU_LIMIT:-1} + memory: ${MEM_LIMIT:-1gb} +networks: + test: + name: test \ No newline at end of file diff --git a/federation/inigo/supergraph.graphql b/federation/inigo/supergraph.graphql new file mode 100644 index 00000000..43dc2879 --- /dev/null +++ b/federation/inigo/supergraph.graphql @@ -0,0 +1,103 @@ +# Generated by Inigo CLI + +schema + @link(for: EXECUTION, url: "https://specs.apollo.dev/join/v0.2") + @link(url: "https://specs.apollo.dev/link/v1.0") { + query: Query +} + +scalar join__FieldSet +scalar link__Import + +enum join__Graph { + ACCOUNTS @join__graph(name: "accounts", url: "http://accounts:4001/graphql") + INVENTORY + @join__graph(name: "inventory", url: "http://inventory:4002/graphql") + PRODUCTS @join__graph(name: "products", url: "http://products:4003/graphql") + REVIEWS @join__graph(name: "reviews", url: "http://reviews:4004/graphql") +} +enum link__Purpose { + """ + `EXECUTION` features provide metadata necessary for operation execution. + """ + EXECUTION + """ + `SECURITY` features provide metadata necessary to securely resolve fields. + """ + SECURITY +} + +type Product + @join__type(extension: true, graph: INVENTORY, key: "upc") + @join__type(extension: true, graph: REVIEWS, key: "upc") + @join__type(graph: PRODUCTS, key: "upc") { + inStock: Boolean @join__field(graph: INVENTORY) + name: String @join__field(graph: PRODUCTS) + price: Int + @join__field(external: true, graph: INVENTORY) + @join__field(graph: PRODUCTS) + reviews: [Review] @join__field(graph: REVIEWS) + shippingEstimate: Int @join__field(graph: INVENTORY, requires: "price weight") + upc: String! + weight: Int + @join__field(external: true, graph: INVENTORY) + @join__field(graph: PRODUCTS) +} +type Query + @join__type(graph: ACCOUNTS) + @join__type(graph: INVENTORY) + @join__type(graph: PRODUCTS) + @join__type(graph: REVIEWS) { + me: User @join__field(graph: ACCOUNTS) + topProducts(first: Int = 5): [Product] @join__field(graph: PRODUCTS) + user(id: ID!): User @join__field(graph: ACCOUNTS) + users: [User] @join__field(graph: ACCOUNTS) +} +type Review @join__type(graph: REVIEWS, key: "id") { + author: User @join__field(graph: REVIEWS, provides: "username") + body: String + id: ID! + product: Product +} +type User + @join__type(extension: true, graph: REVIEWS, key: "id") + @join__type(graph: ACCOUNTS, key: "id") { + birthday: Int @join__field(graph: ACCOUNTS) + id: ID! + name: String @join__field(graph: ACCOUNTS) + reviews: [Review] @join__field(graph: REVIEWS) + username: String + @join__field(external: true, graph: REVIEWS) + @join__field(graph: ACCOUNTS) +} + +directive @join__field( + external: Boolean + graph: join__Graph! + override: String + provides: join__FieldSet + requires: join__FieldSet + type: String + usedOverridden: Boolean +) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION + +directive @join__graph(name: String!, url: String!) on ENUM_VALUE + +directive @join__implements( + graph: join__Graph! + interface: String! +) repeatable on OBJECT | INTERFACE + +directive @join__type( + extension: Boolean! = false + graph: join__Graph! + key: join__FieldSet + resolvable: Boolean! = true +) repeatable on OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT | SCALAR + +directive @link( + as: String + for: link__Purpose + import: [link__Import] + url: String +) repeatable on SCHEMA From 52cb50cc676d870f01a61f50df4f73d6c97a864a Mon Sep 17 00:00:00 2001 From: Arda TANRIKULU Date: Thu, 20 Mar 2025 19:14:40 +0300 Subject: [PATCH 09/10] Bump to Inigo v1 --- federation/inigo/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/federation/inigo/Dockerfile b/federation/inigo/Dockerfile index eb21d0f9..162a1318 100644 --- a/federation/inigo/Dockerfile +++ b/federation/inigo/Dockerfile @@ -4,7 +4,7 @@ FROM alpine:3.19 RUN apk add --no-cache curl -COPY --from=inigohub/gateway:v0.30.15 /usr/bin/gateway . +COPY --from=inigohub/gateway:1.1.0 /usr/bin/gateway . COPY supergraph.graphql ./ COPY config.yaml ./ From 1eeea2a16df7ea8cf93e4540e596cb660d89f759 Mon Sep 17 00:00:00 2001 From: Arda TANRIKULU Date: Thu, 20 Mar 2025 19:15:18 +0300 Subject: [PATCH 10/10] Fix path --- federation/{ => gateways}/inigo/Dockerfile | 0 federation/{ => gateways}/inigo/config.yaml | 0 federation/{ => gateways}/inigo/docker-compose.yaml | 0 federation/{ => gateways}/inigo/supergraph.graphql | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename federation/{ => gateways}/inigo/Dockerfile (100%) rename federation/{ => gateways}/inigo/config.yaml (100%) rename federation/{ => gateways}/inigo/docker-compose.yaml (100%) rename federation/{ => gateways}/inigo/supergraph.graphql (100%) diff --git a/federation/inigo/Dockerfile b/federation/gateways/inigo/Dockerfile similarity index 100% rename from federation/inigo/Dockerfile rename to federation/gateways/inigo/Dockerfile diff --git a/federation/inigo/config.yaml b/federation/gateways/inigo/config.yaml similarity index 100% rename from federation/inigo/config.yaml rename to federation/gateways/inigo/config.yaml diff --git a/federation/inigo/docker-compose.yaml b/federation/gateways/inigo/docker-compose.yaml similarity index 100% rename from federation/inigo/docker-compose.yaml rename to federation/gateways/inigo/docker-compose.yaml diff --git a/federation/inigo/supergraph.graphql b/federation/gateways/inigo/supergraph.graphql similarity index 100% rename from federation/inigo/supergraph.graphql rename to federation/gateways/inigo/supergraph.graphql