console/packages/libraries/sdk-rs/CHANGELOG.md
TheGuildBot 36dd9d3bff
Upcoming Release Changes (#7470)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-12 11:52:17 +01:00

8.4 KiB

hive-console-sdk-rs

0.3.0

Minor Changes

  • #7379 b134461 Thanks @ardatan! - Breaking Changes to avoid future breaking changes;

    Switch to Builder pattern for SupergraphFetcher, PersistedDocumentsManager and UsageAgent structs.

    No more try_new or try_new_async or try_new_sync functions, instead use SupergraphFetcherBuilder, PersistedDocumentsManagerBuilder and UsageAgentBuilder structs 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 b134461 Thanks @ardatan! - Circuit Breaker Implementation and Multiple Endpoints Support

    Implementation of Circuit Breakers in Hive Console Rust SDK, you can learn more here

    Breaking Changes:

    Now endpoint configuration accepts multiple endpoints as an array for SupergraphFetcherBuilder and PersistedDocumentsManager.

    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 0ac2e06 Thanks @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 RecursiveInput type. This would lead to a stack overflow error.

  • #7448 4b796f9 Thanks @kamilkisiela! - export minify_query and normalize_operation functions (mainly for Hive Router)

  • #7439 a9905ec Thanks @jdolle! - Remove the usage flag (!) from non-null, but unused variables to match js sdk

0.2.2

Patch Changes

  • #7405 24c0998 Thanks @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 69e2f74 Thanks @ardatan! - Fix the bug where reports were not being sent correctly due to missing headers

0.2.0

Minor Changes

  • #7246 cc6cd28 Thanks @ardatan! - Breaking;

    • SupergraphFetcher now has two different modes: async and sync. You can choose between SupergraphFetcherAsyncClient and SupergraphFetcherSyncClient based on your needs. See the examples at the bottom.
    • SupergraphFetcher now has a new retry_count parameter to specify how many times to retry fetching the supergraph in case of failures.
    • PersistedDocumentsManager new needs user_agent parameter to be sent to Hive Console when fetching persisted queries.
    • UsageAgent::new is now UsageAgent::try_new and it returns a Result with Arc, 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 the Result when creating a UsageAgent.
    // 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

  • #7248 d8f6e25 Thanks @n1ru4l! - Support project and personal access tokens (hvp1/ and hvu1/).

0.1.0

Minor Changes

  • #7196 7878736 Thanks @ardatan! - Breaking;

    • UsageAgent now accepts Duration for connect_timeout and request_timeout instead of u64.
    • SupergraphFetcher now accepts Duration for connect_timeout and request_timeout instead of u64.
    • PersistedDocumentsManager now accepts Duration for connect_timeout and request_timeout instead of u64.
    • Use original graphql-parser and graphql-tools crates instead of forked versions.

0.0.1

Patch Changes

  • #7143 b80e896 Thanks @ardatan! - Extract Hive Console integration implementation into a new package hive-console-sdk which can be used by any Rust library for Hive Console integration

    It also includes a refactor to use less Mutexes like replacing lru + Mutex with the thread-safe moka package. Only one place that handles queueing uses Mutex now.