Skip to content

Commit

Permalink
add missing types for retry services options (#741)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Liberati authored Feb 20, 2022
1 parent 6091581 commit 1f3da0c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,9 @@ export interface MercuriusGatewayOptions {
gateway: {
services: Array<MercuriusGatewayService>;
pollingInterval?: number;
errorHandler?(error: Error, service: MercuriusGatewayService): void
errorHandler?(error: Error, service: MercuriusGatewayService): void;
retryServicesCount?: number;
retryServicesInterval?: number;
};
}

Expand Down
27 changes: 27 additions & 0 deletions test/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 1f3da0c

Please sign in to comment.