diff --git a/README.md b/README.md index f0d1ff1..90bc179 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ This repository contains a set of tests to evaluate and compare the compatibilit | [Apollo Gateway](https://www.apollographql.com/) | 97.08% | 🟢 166 ❌ 5 | 🟢 38 ❌ 3 | | [Cosmo Router](https://wundergraph.com) | 72.51% | 🟢 124 ❌ 47 | 🟢 19 ❌ 22 | | [Grafbase Gateway](https://grafbase.com) | 59.65% | 🟢 102 ❌ 69 | 🟢 19 ❌ 22 | +| [Inigo Gateway](https://inigo.io) | 46.78% | 🟢 80 ❌ 91 | 🟢 12 ❌ 29 | diff --git a/REPORT.md b/REPORT.md index d2e4a5f..177e0af 100644 --- a/REPORT.md +++ b/REPORT.md @@ -9,6 +9,7 @@ | [Apollo Gateway](https://www.apollographql.com/) | 97.08% | 🟢 166 ❌ 5 | 🟢 38 ❌ 3 | | [Cosmo Router](https://wundergraph.com) | 72.51% | 🟢 124 ❌ 47 | 🟢 19 ❌ 22 | | [Grafbase Gateway](https://grafbase.com) | 59.65% | 🟢 102 ❌ 69 | 🟢 19 ❌ 22 | +| [Inigo Gateway](https://inigo.io) | 46.78% | 🟢 80 ❌ 91 | 🟢 12 ❌ 29 | ## Detailed Results @@ -480,3 +481,96 @@ You can look at the full list of tests [here](./src/test-suites/). Every test id union-intersection
🟢🟢🟢❌❌🟢❌❌
+ + + +### Inigo Gateway + +- [Repository](https://github.com/inigolabs) +- [Website](https://inigo.io) + +
+Results +abstract-types +
🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢❌❌
+child-type-mismatch +
❌❌❌🟢
+circular-reference-interface +
🟢🟢
+complex-entity-call +
+corrupted-supergraph-node-id +
🟢❌❌❌❌🟢🟢🟢🟢🟢
+enum-intersection +
❌❌❌❌❌
+fed1-external-extends +
🟢🟢
+fed1-external-extends-resolvable +
+fed1-external-extension +
🟢🟢
+fed2-external-extends +
🟢🟢
+fed2-external-extension +
🟢🟢
+include-skip +
🟢🟢🟢🟢
+input-object-intersection +
🟢❌❌
+interface-object-with-requires +
❌❌❌❌❌❌❌
+keys-mashup +
+mutations +
🟢🟢❌
+mysterious-external +
🟢🟢
+nested-provides +
❌❌
+node +
🟢
+non-resolvable-interface-object +
🟢🟢🟢🟢🟢❌❌
+null-keys +
+override-type-interface +
❌❌🟢🟢
+override-with-requires +
🟢🟢🟢🟢
+parent-entity-call +
🟢
+parent-entity-call-complex +
+provides-on-interface +
❌❌
+provides-on-union +
❌❌
+requires-interface +
❌❌❌❌❌
+requires-requires +
🟢🟢🟢🟢🟢
+requires-with-argument +
❌❌❌❌❌
+requires-with-fragments +
❌❌❌❌❌❌
+shared-root +
❌❌
+simple-entity-call +
+simple-inaccessible +
🟢🟢❌❌
+simple-interface-object +
❌❌❌❌❌❌❌❌❌❌❌❌❌
+simple-override +
❌🟢
+simple-requires-provides +
🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢
+typename +
❌❌❌❌❌❌
+unavailable-override +
❌🟢
+union-interface-distributed +
❌❌🟢🟢🟢🟢🟢
+union-intersection +
❌❌❌❌❌❌❌❌
+
diff --git a/gateways/inigo-gateway/.gitignore b/gateways/inigo-gateway/.gitignore new file mode 100644 index 0000000..0887852 --- /dev/null +++ b/gateways/inigo-gateway/.gitignore @@ -0,0 +1,6 @@ +/subgraphs/*.graphql +/inigo +/inigo_gateway +/supergraph.graphql +/local.yaml +/subgraphs.json \ No newline at end of file diff --git a/gateways/inigo-gateway/gateway.json b/gateways/inigo-gateway/gateway.json new file mode 100644 index 0000000..417c20c --- /dev/null +++ b/gateways/inigo-gateway/gateway.json @@ -0,0 +1,7 @@ +{ + "name": "Inigo Gateway", + "repository": "https://github.com/inigolabs", + "website": "https://inigo.io", + "graphql": "http://127.0.0.1:4000/graphql", + "health": "http://127.0.0.1:4000/health" +} diff --git a/gateways/inigo-gateway/gateway.yaml b/gateways/inigo-gateway/gateway.yaml new file mode 100644 index 0000000..4617178 --- /dev/null +++ b/gateways/inigo-gateway/gateway.yaml @@ -0,0 +1,6 @@ +listen_port: 4000 +graphql_route: /graphql + +health_check: + enable: true + path: /health diff --git a/gateways/inigo-gateway/inigo.ts b/gateways/inigo-gateway/inigo.ts new file mode 100644 index 0000000..1176333 --- /dev/null +++ b/gateways/inigo-gateway/inigo.ts @@ -0,0 +1,35 @@ +import { writeFileSync, readFileSync, readdirSync, unlinkSync } from "node:fs"; + +for (const file of readdirSync("subgraphs")) { + if (file.endsWith(".graphql")) { + unlinkSync(`subgraphs/${file}`); + } +} + +const subgraphs: Array<{ + name: string; + url: string; + sdl: string; +}> = JSON.parse(readFileSync("subgraphs.json", "utf-8")); + +let yaml = ` +kind: Gateway +name: audit +label: dev +spec: + composition: ApolloFederation_v2 + services: +`; + +for (const subgraph of subgraphs) { + writeFileSync(`subgraphs/${subgraph.name}.graphql`, subgraph.sdl, "utf-8"); + + yaml += ` + - name: ${subgraph.name} + url: ${subgraph.url} + schema_files: + - ./subgraphs/${subgraph.name}.graphql +`; +} + +writeFileSync("local.yaml", yaml, "utf-8"); diff --git a/gateways/inigo-gateway/install.sh b/gateways/inigo-gateway/install.sh new file mode 100755 index 0000000..99910d5 --- /dev/null +++ b/gateways/inigo-gateway/install.sh @@ -0,0 +1,164 @@ +#!/bin/sh + +set -u + +# Inigo has no install.sh script, so I took the install.sh script from the router gateway +# and modified it to download the Inigo binary instead of the router binary + +BINARY_DOWNLOAD_PREFIX="https://github.com/inigolabs/artifacts/releases/download" + +DOWNLOAD_VERSION="v0.30.14" + +download_binaries() { + downloader --check + need_cmd mktemp + need_cmd chmod + need_cmd mkdir + need_cmd rm + need_cmd rmdir + need_cmd tar + need_cmd which + need_cmd dirname + need_cmd awk + need_cmd cut + + get_architecture || return 1 + _arch="$RETVAL" + assert_nz "$_arch" "arch" + + _tardir="$DOWNLOAD_VERSION/cli_${_arch}" + _url="$BINARY_DOWNLOAD_PREFIX/${_tardir}.tar.gz" + + _dir="$(mktemp -d 2>/dev/null || ensure mktemp -d -t tmp_bin)" + _file="$_dir/input.tar.gz" + + say "Downloading inigo from $_url ..." 1>&2 + + ensure mkdir -p "$_dir" + downloader "$_url" "$_file" + if [ $? != 0 ]; then + say "Failed to download $_url" + exit 1 + fi + + ensure tar xf "$_file" -C "$_dir" + + ls -l "$_dir" + + _cli_outfile="./inigo" + _cli="$_dir/inigo" + + say "Moving $_cli to $_cli_outfile ..." + mv "$_cli" "$_cli_outfile" + + _retval=$? + + say "" + + _gateway_outfile="./inigo_gateway" + _gateway="$_dir/inigo_gateway" + + say "Moving $_gateway to $_gateway_outfile ..." + mv "$_gateway" "$_gateway_outfile" + + _retval=$? + + say "" + + ignore rm -rf "$_dir" + + return "$_retval" +} + +get_architecture() { + case $(uname -ms) in + 'Darwin x86_64') + target=darwin_all + ;; + 'Darwin arm64') + target=darwin_all + ;; + 'Linux arm64') + target=linux_arm64 + ;; + 'Linux aarch64') + target=linux_amd64 + ;; + 'Linux x86_64' | *) + target=linux_amd64 + ;; + esac + + RETVAL="$target" +} + +say() { + green=$(tput setaf 2 2>/dev/null || echo '') + reset=$(tput sgr0 2>/dev/null || echo '') + echo "$1" +} + +err() { + red=$(tput setaf 1 2>/dev/null || echo '') + reset=$(tput sgr0 2>/dev/null || echo '') + say "${red}ERROR${reset}: $1" >&2 + exit 1 +} + +need_cmd() { + if ! check_cmd "$1" + then err "Installation halted. Reason: [command not found '$1' - please install this command]" + fi +} + +check_cmd() { + command -v "$1" > /dev/null 2>&1 + return $? +} + +need_ok() { + if [ $? != 0 ]; then err "$1"; fi +} + +assert_nz() { + if [ -z "$1" ]; then err "assert_nz $2"; fi +} + +# Run a command that should never fail. If the command fails execution +# will immediately terminate with an error showing the failing +# command. +ensure() { + "$@" + need_ok "command failed: $*" +} + +# This is just for indicating that commands' results are being +# intentionally ignored. Usually, because it's being executed +# as part of error handling. +ignore() { + "$@" +} + +# This wraps curl or wget. Try curl first, if not installed, +# use wget instead. +downloader() { + if check_cmd curl + then _dld=curl + elif check_cmd wget + then _dld=wget + else _dld='curl or wget' # to be used in error message of need_cmd + fi + + if [ "$1" = --check ] + then need_cmd "$_dld" + elif [ "$_dld" = curl ] + then curl -sSfL "$1" -o "$2" + elif [ "$_dld" = wget ] + then wget "$1" -O "$2" + else err "Unknown downloader" # should not reach here + fi +} + +download_binaries "$@" || exit 1 + +echo "success" diff --git a/gateways/inigo-gateway/results.txt b/gateways/inigo-gateway/results.txt new file mode 100644 index 0000000..830251d --- /dev/null +++ b/gateways/inigo-gateway/results.txt @@ -0,0 +1,87 @@ +abstract-types +...............XX +child-type-mismatch +XXX. +circular-reference-interface +.. +complex-entity-call +X +corrupted-supergraph-node-id +.XXXX..... +enum-intersection +XXXXX +fed1-external-extends +.. +fed1-external-extends-resolvable +X +fed1-external-extension +.. +fed2-external-extends +.. +fed2-external-extension +.. +include-skip +.... +input-object-intersection +.XX +interface-object-with-requires +XXXXXXX +keys-mashup +X +mutations +..X +mysterious-external +.. +nested-provides +XX +node +. +non-resolvable-interface-object +.....XX +null-keys +X +override-type-interface +XX.. +override-with-requires +.... +parent-entity-call +. +parent-entity-call-complex +X +provides-on-interface +XX +provides-on-union +XX +requires-interface +XXXXX +requires-requires +..... +requires-with-argument +XXXXX +requires-with-fragments +XXXXXX +shared-root +XX +simple-entity-call +X +simple-inaccessible +..XX +simple-interface-object +XXXXXXXXXXXXX +simple-override +X. +simple-requires-provides +............ +typename +XXXXXX +unavailable-override +X. +union-interface-distributed +XX..... +union-intersection +XXXXXXXX + +--- +Total: 171 +Passed: 80 +Failed: 91 \ No newline at end of file diff --git a/gateways/inigo-gateway/run.sh b/gateways/inigo-gateway/run.sh new file mode 100755 index 0000000..44749d6 --- /dev/null +++ b/gateways/inigo-gateway/run.sh @@ -0,0 +1,6 @@ +npm start subgraphs -- --cwd ./gateways/inigo-gateway --test $1 +npx tsx ./inigo.js + +./inigo compose local.yaml > supergraph.graphql + +./inigo_gateway --schema supergraph.graphql --config gateway.yaml \ No newline at end of file diff --git a/gateways/inigo-gateway/subgraphs/.gitkeep b/gateways/inigo-gateway/subgraphs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/website/index.html b/website/index.html index e376190..0129c0b 100644 --- a/website/index.html +++ b/website/index.html @@ -364,6 +364,36 @@

+ + + + Inigo Gateway + + + 46.78% + + ✓ 80 + ✗ 91 + + + ✓ 12 + ✗ 29 + + + View report + + + @@ -515,7 +545,7 @@

The testing process involves: