From 1f3da0c20b06a7575c440008dc07c23137cb0823 Mon Sep 17 00:00:00 2001 From: Luca Liberati Date: Sun, 20 Feb 2022 10:31:16 +0100 Subject: [PATCH] add missing types for retry services options (#741) --- index.d.ts | 4 +++- test/types/index.ts | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 6cfc6fc6..fde9a1f6 100644 --- a/index.d.ts +++ b/index.d.ts @@ -402,7 +402,9 @@ export interface MercuriusGatewayOptions { gateway: { services: Array; pollingInterval?: number; - errorHandler?(error: Error, service: MercuriusGatewayService): void + errorHandler?(error: Error, service: MercuriusGatewayService): void; + retryServicesCount?: number; + retryServicesInterval?: number; }; } diff --git a/test/types/index.ts b/test/types/index.ts index 980114fc..db32355a 100644 --- a/test/types/index.ts +++ b/test/types/index.ts @@ -388,6 +388,33 @@ gateway.register(mercurius, { } }) +// Gateway mode with custom services retry props +gateway.register(mercurius, { + gateway: { + services: [ + { + name: 'user', + url: 'http://localhost:4001/graphql' + } + ], + retryServicesCount: 30, + retryServicesInterval: 5000 + } +}) + +expectError(() => gateway.register(mercurius, { + gateway: { + services: [ + { + name: 'user', + url: 'http://localhost:4001/graphql' + } + ], + retryServicesCount: '30', + retryServicesInterval: '5000' + } +})) + // Executable schema const executableSchema = makeExecutableSchema({