apollographql / apollographql/apollo-server
heartbeatIntervalMs missing from ApolloServerPluginSubscriptionCallback options
- Dominant language
- TypeScript
- Stars
- 14k
- Forks
- 2k
- Avg merge
- 5h 30m
- Merged PRs (30d)
- 1
Description
### Issue Description
Apollo Server docs for `ApolloServerPluginSubscriptionCallback` mention a configurable
`heartbeatIntervalMs`, but the current TypeScript interface does not expose this option.
As a result, users cannot configure heartbeat behavior in a supported or type-safe way.
Docs reference:
https://github.com/apollographql/apollo-server/blob/main/docs/source/api/plugin/subscription-callback.mdx#heartbeatintervalms
HTTP-callback subscriptions are sensitive to timing and latency between the router/gateway
and the subgraph.
Without a supported way to configure the subgraph’s heartbeat interval:
- we cannot compensate for event-loop jitter or network latency
- valid subscriptions may be terminated despite healthy communication
### Link to Reproduction
https://github.com/mario-jerkovic/apollo-server-subscription-callback-plugin-issue
### Reproduction Steps
Run:
```bash
yarn install
yarn build
```
Actual `tsc` fails with and error
```bash
error TS2353: Object literal may only specify known properties, and 'heartbeatIntervalMs' does not exist in type 'ApolloServerPluginSubscriptionCallbackOptions'.
```
Contributor guide
Research direction
Locate the TypeScript definition of ApolloServerPluginSubscriptionCallbackOptions and compare it with the heartbeatIntervalMs option documented in the linked API page. Use the reproduction repository and run yarn install, then yarn build; done means the example type-checks without the TS2353 error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100