Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
8.4 KiB
hive-console-sdk-rs
0.3.0
Minor Changes
-
#7379
b134461Thanks @ardatan! - Breaking Changes to avoid future breaking changes;Switch to Builder pattern for
SupergraphFetcher,PersistedDocumentsManagerandUsageAgentstructs.No more
try_newortry_new_asyncortry_new_syncfunctions, instead useSupergraphFetcherBuilder,PersistedDocumentsManagerBuilderandUsageAgentBuilderstructs to create instances.Benefits;
- No need to provide all parameters at once when creating an instance even for default values.
Example;
// Before let fetcher = SupergraphFetcher::try_new_async( "SOME_ENDPOINT", // endpoint "SOME_KEY", "MyUserAgent/1.0".to_string(), Duration::from_secs(5), // connect_timeout Duration::from_secs(10), // request_timeout false, // accept_invalid_certs 3, // retry_count )?; // After // No need to provide all parameters at once, can use default values let fetcher = SupergraphFetcherBuilder::new() .endpoint("SOME_ENDPOINT".to_string()) .key("SOME_KEY".to_string()) .build_async()?;- Easier to add new configuration options in the future without breaking existing code.
Example;
let fetcher = SupergraphFetcher::try_new_async( "SOME_ENDPOINT", // endpoint "SOME_KEY", "MyUserAgent/1.0".to_string(), Duration::from_secs(5), // connect_timeout Duration::from_secs(10), // request_timeout false, // accept_invalid_certs 3, // retry_count circuit_breaker_config, // Breaking Change -> new parameter added )?; let fetcher = SupergraphFetcherBuilder::new() .endpoint("SOME_ENDPOINT".to_string()) .key("SOME_KEY".to_string()) .build_async()?; // No breaking change, circuit_breaker_config can be added later if needed
Patch Changes
-
#7379
b134461Thanks @ardatan! - Circuit Breaker Implementation and Multiple Endpoints SupportImplementation of Circuit Breakers in Hive Console Rust SDK, you can learn more here
Breaking Changes:
Now
endpointconfiguration accepts multiple endpoints as an array forSupergraphFetcherBuilderandPersistedDocumentsManager.SupergraphFetcherBuilder::default() - .endpoint(endpoint) + .add_endpoint(endpoint1) + .add_endpoint(endpoint2)This change requires updating the configuration structure to accommodate multiple endpoints.
0.2.3
Patch Changes
-
#7446
0ac2e06Thanks @ardatan! - Fixed the stack overflow error while collecting schema coordinates from the recursive input object types correctly;Let's consider the following schema:
input RecursiveInput { field: String nested: RecursiveInput }And you have an operation that uses this input type:
query UserQuery($input: RecursiveInput!) { user(input: $input) { id } }When collecting schema coordinates from operations that use this input type, the previous implementation could enter an infinite recursion when traversing the nested
RecursiveInputtype. This would lead to a stack overflow error. -
#7448
4b796f9Thanks @kamilkisiela! - exportminify_queryandnormalize_operationfunctions (mainly for Hive Router) -
#7439
a9905ecThanks @jdolle! - Remove the usage flag (!) from non-null, but unused variables to match js sdk
0.2.2
Patch Changes
- #7405
24c0998Thanks @ardatan! - Use the JSON Schema specification of the usage reports directly to generate Rust structs as a source of truth instead of manually written types
0.2.1
Patch Changes
- #7364
69e2f74Thanks @ardatan! - Fix the bug where reports were not being sent correctly due to missing headers
0.2.0
Minor Changes
-
#7246
cc6cd28Thanks @ardatan! - Breaking;SupergraphFetchernow has two different modes: async and sync. You can choose betweenSupergraphFetcherAsyncClientandSupergraphFetcherSyncClientbased on your needs. See the examples at the bottom.SupergraphFetchernow has a newretry_countparameter to specify how many times to retry fetching the supergraph in case of failures.PersistedDocumentsManagernew needsuser_agentparameter to be sent to Hive Console when fetching persisted queries.UsageAgent::newis nowUsageAgent::try_newand it returns aResultwithArc, so you can freely clone it across threads. This change was made to handle potential errors during the creation of the HTTP client. Make sure to handle theResultwhen creating aUsageAgent.
// Sync Mode let fetcher = SupergraphFetcher::try_new_sync(/* params */) .map_err(|e| anyhow!("Failed to create SupergraphFetcher: {}", e))?; // Use the fetcher to fetch the supergraph (Sync) let supergraph = fetcher .fetch_supergraph() .map_err(|e| anyhow!("Failed to fetch supergraph: {}", e))?; // Async Mode let fetcher = SupergraphFetcher::try_new_async(/* params */) .map_err(|e| anyhow!("Failed to create SupergraphFetcher: {}", e))?; // Use the fetcher to fetch the supergraph (Async) let supergraph = fetcher .fetch_supergraph() .await .map_err(|e| anyhow!("Failed to fetch supergraph: {}", e))?;
0.1.1
Patch Changes
0.1.0
Minor Changes
-
#7196
7878736Thanks @ardatan! - Breaking;UsageAgentnow acceptsDurationforconnect_timeoutandrequest_timeoutinstead ofu64.SupergraphFetchernow acceptsDurationforconnect_timeoutandrequest_timeoutinstead ofu64.PersistedDocumentsManagernow acceptsDurationforconnect_timeoutandrequest_timeoutinstead ofu64.- Use original
graphql-parserandgraphql-toolscrates instead of forked versions.
0.0.1
Patch Changes
-
#7143
b80e896Thanks @ardatan! - Extract Hive Console integration implementation into a new packagehive-console-sdkwhich can be used by any Rust library for Hive Console integrationIt also includes a refactor to use less Mutexes like replacing
lru+Mutexwith the thread-safemokapackage. Only one place that handles queueing usesMutexnow.