Skip to content

Commit e13cfe1

Browse files
committed
..
1 parent f6a9b4b commit e13cfe1

File tree

7 files changed

+20
-37
lines changed

7 files changed

+20
-37
lines changed

e2e/subscriptions-type-merging/gateway.config.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Redis } from 'ioredis';
22
import { defineConfig as defineGatewayConfig } from '@graphql-hive/gateway';
33
import { RedisPubSub } from '@graphql-hive/pubsub/redis';
4-
import { toMeshPubSub } from '@graphql-mesh/types';
54

65
/**
76
* When a Redis connection enters "subscriber mode" (after calling SUBSCRIBE), it can only execute
@@ -20,12 +19,10 @@ const sub = new Redis({
2019
});
2120

2221
export const gatewayConfig = defineGatewayConfig({
23-
pubsub: toMeshPubSub(
24-
new RedisPubSub(
25-
{ pub, sub },
26-
{
27-
channelPrefix: 'gw',
28-
},
29-
),
22+
pubsub: new RedisPubSub(
23+
{ pub, sub },
24+
{
25+
channelPrefix: 'gw',
26+
},
3027
),
3128
});

e2e/subscriptions-type-merging/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"private": true,
44
"dependencies": {
55
"@graphql-hive/gateway": "^2.0.0",
6-
"@graphql-hive/pubsub": "next",
6+
"@graphql-hive/pubsub": "^2.1.0",
77
"graphql": "^16.9.0",
88
"graphql-sse": "^2.5.4",
99
"ioredis": "^5.7.0"

packages/legacy/types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"graphql": "*"
3636
},
3737
"dependencies": {
38-
"@graphql-hive/pubsub": "next",
38+
"@graphql-hive/pubsub": "^2.1.0",
3939
"@graphql-mesh/store": "^0.104.11",
4040
"@graphql-tools/batch-delegate": "^10.0.0",
4141
"@graphql-tools/delegate": "^11.0.0",

packages/plugins/http-cache/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ export default function useHTTPCache<TContext extends Record<string, any>>({
159159
);
160160
},
161161
);
162+
// @ts-expect-error - Promise type mismatch
162163
context?.waitUntil?.(store$);
163164
}
164165
if (policy) {

packages/plugins/operation-headers/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function useOperationHeaders(factoryFn: OperationHeadersFactory): Gateway
2222
url,
2323
options,
2424
context,
25-
}),
25+
} as OperationHeadersFactoryPayload),
2626
newHeaders =>
2727
setOptions({
2828
...options,

packages/plugins/response-cache/src/index.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -256,15 +256,16 @@ export default function useMeshResponseCache(
256256
const cacheControlHeader = response.headers.get('cache-control');
257257
if (cacheControlHeader != null) {
258258
const parsedCacheControl = CacheControlParser.parse(cacheControlHeader);
259-
if (parsedCacheControl['max-age'] != null) {
260-
const maxAgeInSeconds = parsedCacheControl['max-age'];
261-
const maxAgeInMs = maxAgeInSeconds * 1000;
262-
checkTtl(context, maxAgeInMs);
259+
const headerNames = ['max-age', 's-maxage'];
260+
function checkHeaderTtl(headerName: string) {
261+
if (parsedCacheControl[headerName] != null) {
262+
const maxAgeInSeconds = parsedCacheControl[headerName];
263+
const maxAgeInMs = maxAgeInSeconds * 1000;
264+
checkTtl(context as GatewayContext, maxAgeInMs);
265+
}
263266
}
264-
if (parsedCacheControl['s-maxage'] != null) {
265-
const sMaxAgeInSeconds = parsedCacheControl['s-maxage'];
266-
const sMaxAgeInMs = sMaxAgeInSeconds * 1000;
267-
checkTtl(context, sMaxAgeInMs);
267+
for (const headerName of headerNames) {
268+
checkHeaderTtl(headerName);
268269
}
269270
}
270271
};

yarn.lock

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4273,7 +4273,7 @@ __metadata:
42734273
resolution: "@e2e/subscriptions-type-merging@workspace:e2e/subscriptions-type-merging"
42744274
dependencies:
42754275
"@graphql-hive/gateway": "npm:^2.0.0"
4276-
"@graphql-hive/pubsub": "npm:next"
4276+
"@graphql-hive/pubsub": "npm:^2.1.0"
42774277
graphql: "npm:^16.9.0"
42784278
graphql-sse: "npm:^2.5.4"
42794279
ioredis: "npm:^5.7.0"
@@ -6662,22 +6662,6 @@ __metadata:
66626662
languageName: node
66636663
linkType: hard
66646664

6665-
"@graphql-hive/pubsub@npm:next":
6666-
version: 2.0.0-next-4830ed6f34eb399e328ddb4d05f88aaff04fab46
6667-
resolution: "@graphql-hive/pubsub@npm:2.0.0-next-4830ed6f34eb399e328ddb4d05f88aaff04fab46"
6668-
dependencies:
6669-
"@repeaterjs/repeater": "npm:^3.0.6"
6670-
"@whatwg-node/disposablestack": "npm:^0.0.6"
6671-
"@whatwg-node/promise-helpers": "npm:^1.3.0"
6672-
peerDependencies:
6673-
ioredis: ^5
6674-
peerDependenciesMeta:
6675-
ioredis:
6676-
optional: true
6677-
checksum: 10c0/0478579aeabb3579aa96c4b746c34aaca07876df5af94521f786f64ac45e1f714825049f5b4850d07714daec1d5cd28cd07098bbf325fc657f9d03e6d6668a9a
6678-
languageName: node
6679-
linkType: hard
6680-
66816665
"@graphql-hive/signal@npm:^1.0.0":
66826666
version: 1.0.0
66836667
resolution: "@graphql-hive/signal@npm:1.0.0"
@@ -8238,7 +8222,7 @@ __metadata:
82388222
version: 0.0.0-use.local
82398223
resolution: "@graphql-mesh/types@workspace:packages/legacy/types"
82408224
dependencies:
8241-
"@graphql-hive/pubsub": "npm:next"
8225+
"@graphql-hive/pubsub": "npm:^2.1.0"
82428226
"@graphql-mesh/store": "npm:^0.104.11"
82438227
"@graphql-tools/batch-delegate": "npm:^10.0.0"
82448228
"@graphql-tools/delegate": "npm:^11.0.0"

0 commit comments

Comments
 (0)