pub struct GraphqlStreamConfig {
pub endpoint: String,
pub query: String,
pub variables: Value,
pub auth: GraphqlAuth,
pub headers: HeaderMap,
pub records_path: Option<String>,
pub pagination: Option<GraphqlPagination>,
pub max_pages: Option<usize>,
}Expand description
Configuration for the GraphQL source.
Fields§
§endpoint: StringGraphQL endpoint URL.
query: StringThe GraphQL query string.
variables: ValueVariables to pass with the query.
auth: GraphqlAuthAuthentication method.
headers: HeaderMapAdditional request headers.
records_path: Option<String>JSONPath expression to extract records from the response.
pagination: Option<GraphqlPagination>Pagination configuration. None for single-page queries.
max_pages: Option<usize>Maximum number of pages to fetch.
Implementations§
Source§impl GraphqlStreamConfig
impl GraphqlStreamConfig
Sourcepub fn new(endpoint: impl Into<String>, query: impl Into<String>) -> Self
pub fn new(endpoint: impl Into<String>, query: impl Into<String>) -> Self
Create a new config with an endpoint and query.
Sourcepub fn auth(self, auth: GraphqlAuth) -> Self
pub fn auth(self, auth: GraphqlAuth) -> Self
Set the authentication method.
Sourcepub fn records_path(self, path: impl Into<String>) -> Self
pub fn records_path(self, path: impl Into<String>) -> Self
Set the JSONPath expression for record extraction.
Sourcepub fn pagination(self, pagination: GraphqlPagination) -> Self
pub fn pagination(self, pagination: GraphqlPagination) -> Self
Enable cursor-based pagination with the given configuration.
Trait Implementations§
Source§impl Clone for GraphqlStreamConfig
impl Clone for GraphqlStreamConfig
Source§fn clone(&self) -> GraphqlStreamConfig
fn clone(&self) -> GraphqlStreamConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GraphqlStreamConfig
impl Debug for GraphqlStreamConfig
Source§impl<'de> Deserialize<'de> for GraphqlStreamConfig
impl<'de> Deserialize<'de> for GraphqlStreamConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for GraphqlStreamConfig
impl JsonSchema for GraphqlStreamConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for GraphqlStreamConfig
impl RefUnwindSafe for GraphqlStreamConfig
impl Send for GraphqlStreamConfig
impl Sync for GraphqlStreamConfig
impl Unpin for GraphqlStreamConfig
impl UnsafeUnpin for GraphqlStreamConfig
impl UnwindSafe for GraphqlStreamConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more