RelayArgsInterface / Sink
Public types describing the configuration of CreateRelayEnvironment
(RelayArgsInterface) and the Relay Observable sink (Sink).
RelayArgsInterface is the input contract of
CreateRelayEnvironment: any change here is part of the package's public
API. Sink is the minimal Observable interface that Relay
exposes — used internally by the fetch/subscription handlers.
When to use
| ✅ Use when… | 🚫 Avoid when… |
|---|---|
|
|
Example
import { CreateRelayEnvironment } from '@apollion-dsi/relay';
import { RelayArgsInterface } from '@apollion-dsi/relay/relayArgsInterface';
const baseConfig: RelayArgsInterface = {
url: 'https://api.example.com/graphql/',
useRetries: true,
retries: [1000, 2000, 5000],
usePersistedQueries: true, // send only build-time hashes (server allowlist)
};
const { Environment } = new CreateRelayEnvironment({
...baseConfig,
useDebug: process.env.NODE_ENV !== 'production',
});Granular imports
import { RelayArgsInterface, Sink } from '@apollion-dsi/relay/relayArgsInterface';
// or via the root barrel
import { RelayArgsInterface, Sink } from '@apollion-dsi/relay';See also
- Full API:
relayArgsInterface.ts. - Consumers of these types:
setupRelayEnvironment.