pub struct UrlSourceConfig {
pub url: String,
pub headers: HashMap<String, String>,
pub stale_after: Option<u64>,
pub swr: Option<u64>,
}Expand description
@source(url: "...", headers: { ... }, staleAfter:, swr:).
Fields§
§url: StringOrigin URL template. {id} substitution supported.
headers: HashMap<String, String>Static headers attached to every request. Key format
limitation: GraphQL object-literal keys must be Name
identifiers (no dashes, no quoted strings), so a header
Authorization is written as authorization: in the schema
and X-Tenant as x_tenant:. The runtime is responsible for
translating these back into HTTP-shape header names (most
HTTP servers match headers case-insensitively, but if you
need exact wire-format header names with dashes, use the
function: arm instead).
stale_after: Option<u64>Seconds after which a cached record is considered stale.
None = serve until manually invalidated.
swr: Option<u64>Seconds beyond stale_after during which a stale record is
returned to the caller while a background refresh runs.
Trait Implementations§
Source§impl Clone for UrlSourceConfig
impl Clone for UrlSourceConfig
Source§fn clone(&self) -> UrlSourceConfig
fn clone(&self) -> UrlSourceConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more