Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ee748a0
v0 gateway-testing
enisdenjo Oct 24, 2025
825f7da
provide maybe yoga
enisdenjo Oct 24, 2025
8f1f2a9
rename to simply testing
enisdenjo Oct 24, 2025
3fe1550
export necessary
enisdenjo Oct 24, 2025
c36d6b3
try out
enisdenjo Oct 24, 2025
5de48c4
use subgraph url
enisdenjo Oct 24, 2025
ac2c4bb
changeset
enisdenjo Oct 24, 2025
d560b9a
really test
enisdenjo Oct 24, 2025
0959980
easier build schema and better yoga provider
enisdenjo Oct 24, 2025
2d4355f
async disposable
enisdenjo Oct 24, 2025
9a72245
update lockfile
enisdenjo Oct 24, 2025
a0bfd37
dispose
enisdenjo Oct 24, 2025
c758f4f
bun is ok now?
enisdenjo Oct 24, 2025
76f75ec
use build subgraph schema instead
enisdenjo Oct 24, 2025
bd3d405
chore(dependencies): updated changesets for modified dependencies
github-actions[bot] Oct 24, 2025
a00b314
executor http is a dep
enisdenjo Oct 27, 2025
b9e8871
no mask errors when testing
enisdenjo Oct 27, 2025
32071c8
use yoga graphql endpoint for url
enisdenjo Oct 27, 2025
f26cd28
refactor use gateway tester
enisdenjo Oct 27, 2025
8977282
tester host for whatever
enisdenjo Oct 27, 2025
1a00156
aws outgoing
enisdenjo Oct 27, 2025
4c85a61
proxy mode
enisdenjo Oct 27, 2025
aae0514
unnecessary createyoga
enisdenjo Oct 27, 2025
aa8eb81
hmac signatures
enisdenjo Oct 27, 2025
f6cc854
no createyoga in tester
enisdenjo Oct 27, 2025
b32b8ab
support polling
enisdenjo Oct 27, 2025
cacff36
match mode types
enisdenjo Oct 27, 2025
7e6c17b
better fetch setter and susbiscrpns migrate
enisdenjo Oct 27, 2025
36b9ff6
start prop headers
enisdenjo Oct 27, 2025
c86b839
propagat hed teste
enisdenjo Oct 27, 2025
cb6291e
debug enables logging
enisdenjo Oct 27, 2025
533f2a0
headers only for proxy
enisdenjo Oct 27, 2025
80cf1f9
up tim
enisdenjo Oct 27, 2025
23e9828
tester in index because why not
enisdenjo Oct 27, 2025
f555607
unused
enisdenjo Oct 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@graphql-hive/plugin-aws-sigv4': patch
---

dependencies updates:

- Updated dependency [`@aws-sdk/client-sts@^3.916.0` ↗︎](https://www.npmjs.com/package/@aws-sdk/client-sts/v/3.916.0) (from `^3.914.0`, in `dependencies`)
5 changes: 5 additions & 0 deletions .changeset/dry-numbers-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-hive/gateway-testing': major
---

Hive Gateway tester and testing utilities
36 changes: 9 additions & 27 deletions packages/plugins/aws-sigv4/tests/aws-sigv4-incoming.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import { buildSubgraphSchema } from '@apollo/subgraph';
import { createInlineSigningKeyProvider, useJWT } from '@graphql-hive/gateway';
import {
createGatewayRuntime,
useCustomFetch,
} from '@graphql-hive/gateway-runtime';
import { composeLocalSchemasWithApollo } from '@internal/testing';
import { createGatewayTester } from '@graphql-hive/gateway-testing';
import { parse } from 'graphql';
import { createYoga } from 'graphql-yoga';
import { describe, expect, it } from 'vitest';
import { useAWSSigv4 } from '../src';

Expand All @@ -23,18 +18,14 @@ describe('AWS Sigv4 Incoming requests', () => {
},
},
});
const subgraphServer = createYoga({
schema: subgraphSchema,
});
it('validates incoming requests', async () => {
await using gw = createGatewayRuntime({
supergraph: composeLocalSchemasWithApollo([
await using gw = createGatewayTester({
subgraphs: [
{
name: 'subgraph',
schema: subgraphSchema,
url: 'http://localhost:4000/graphql',
},
]),
],
landingPage: false,
graphqlEndpoint: '/',
plugins: () => [
Expand All @@ -43,10 +34,6 @@ describe('AWS Sigv4 Incoming requests', () => {
secretAccessKey: () => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
},
}),
useCustomFetch(
// @ts-expect-error - MeshFetch is not compatible with Yoga.fetch
subgraphServer.fetch,
),
],
});
const response = await gw.fetch(
Expand All @@ -59,7 +46,7 @@ describe('AWS Sigv4 Incoming requests', () => {
Date: 'Mon, 29 Dec 2015 00:00:00 GMT',
'content-type': 'application/json',
Host: 'sigv4examplegraphqlbucket.s3-eu-central-1.amazonaws.com',
'Content-Length': 30,
'Content-Length': '30',
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Content-Length header value has been changed from a number (30) to a string ('30'). This may indicate a breaking change in how headers are handled. Verify that the gateway and AWS SigV4 signing logic correctly handle Content-Length as a string, as HTTP headers are typically strings but the signature calculation might expect specific formatting.

Copilot uses AI. Check for mistakes.
'X-Amz-Content-Sha256':
'34c77dc7b593717e0231ac99a16ae3be5ee2e8d652bce6518738a6449dfd2647',
'X-Amz-Date': '20151229T000000Z',
Expand All @@ -82,14 +69,13 @@ describe('AWS Sigv4 Incoming requests', () => {
});
it('works with JWT', async () => {
const JWT_SECRET = 'a-string-secret-at-least-256-bits-long';
await using gw = createGatewayRuntime({
supergraph: composeLocalSchemasWithApollo([
await using gw = createGatewayTester({
subgraphs: [
{
name: 'subgraph',
schema: subgraphSchema,
url: 'http://localhost:4000/graphql',
},
]),
],
landingPage: false,
graphqlEndpoint: '/',
plugins: () => [
Expand All @@ -108,10 +94,6 @@ describe('AWS Sigv4 Incoming requests', () => {
secretAccessKey: () => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
},
}),
useCustomFetch(
// @ts-expect-error - MeshFetch is not compatible with Yoga.fetch
subgraphServer.fetch,
),
],
});

Expand All @@ -125,7 +107,7 @@ describe('AWS Sigv4 Incoming requests', () => {
Date: 'Mon, 29 Dec 2015 00:00:00 GMT',
'content-type': 'application/json',
Host: 'sigv4examplegraphqlbucket.s3-eu-central-1.amazonaws.com',
'Content-Length': 30,
'Content-Length': '30',
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Content-Length header value has been changed from a number (30) to a string ('30'). This may indicate a breaking change in how headers are handled. Verify that the gateway and AWS SigV4 signing logic correctly handle Content-Length as a string, as HTTP headers are typically strings but the signature calculation might expect specific formatting.

Copilot uses AI. Check for mistakes.
'X-Amz-Content-Sha256':
'34c77dc7b593717e0231ac99a16ae3be5ee2e8d652bce6518738a6449dfd2647',
'X-Amz-Date': '20151229T000000Z',
Expand Down
42 changes: 16 additions & 26 deletions packages/plugins/aws-sigv4/tests/aws-sigv4-outgoing.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import { buildSubgraphSchema } from '@apollo/subgraph';
import {
createGatewayRuntime,
useCustomFetch,
} from '@graphql-hive/gateway-runtime';
import { createGatewayTester } from '@graphql-hive/gateway-testing';
import { useAWSSigv4 } from '@graphql-hive/plugin-aws-sigv4';
import { composeLocalSchemasWithApollo } from '@internal/testing';
import { parse } from 'graphql';
import { createYoga } from 'graphql-yoga';
import { describe, expect, it } from 'vitest';

describe('AWS Sigv4', () => {
Expand All @@ -24,26 +19,25 @@ describe('AWS Sigv4', () => {
},
});
let receivedSubgraphRequest: Request | undefined;
await using subgraphServer = createYoga({
schema: subgraphSchema,
plugins: [
{
onRequest({ request }) {
receivedSubgraphRequest = request;
},
},
],
landingPage: false,
graphqlEndpoint: '/',
});
await using gw = createGatewayRuntime({
supergraph: await composeLocalSchemasWithApollo([
await using gw = createGatewayTester({
subgraphs: [
{
name: 'subgraph',
schema: subgraphSchema,
url: 'http://sigv4examplegraphqlbucket.s3-eu-central-1.amazonaws.com',
host: 'sigv4examplegraphqlbucket.s3-eu-central-1.amazonaws.com',
yoga: {
plugins: [
{
onRequest({ request }) {
receivedSubgraphRequest = request;
},
},
],
landingPage: false,
graphqlEndpoint: '/',
},
},
]),
],
transportEntries: {
subgraph: {
headers: [['Date', 'Mon, 29 Dec 2015 00:00:00 GMT']],
Expand All @@ -57,10 +51,6 @@ describe('AWS Sigv4', () => {
secretAccessKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
},
}),
useCustomFetch(
// @ts-expect-error - MeshFetch is not compatible with Yoga.fetch
subgraphServer.fetch,
),
],
});
const res = await gw.fetch('http://localhost:4000/graphql', {
Expand Down
Loading
Loading